Cambio: home mostrata con componenti
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
@using MP.AppAuth.Models
|
||||
@using MP.Land.Data
|
||||
@using Microsoft.Extensions.Configuration
|
||||
|
||||
@inject IConfiguration Configuration
|
||||
|
||||
@inject AppAuthService DataService
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@if (authOk())
|
||||
{
|
||||
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="text-info" title="Apri">
|
||||
<h3 class="mb-0">@CurrItem.AppName <i class="fas fa-link"></i></h3>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<del>
|
||||
<h3 class="mb-0 text-secondary">@CurrItem.AppName</h3>
|
||||
</del>
|
||||
}
|
||||
</div>
|
||||
<div class="card-body pb-0">
|
||||
<div class="row">
|
||||
@if (authOk())
|
||||
{
|
||||
<div class="col-3 text-info">
|
||||
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
||||
</div>
|
||||
<div class="col-9" style="overflow-y: auto; height: 8em;">
|
||||
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
||||
<ul style="mb-0">
|
||||
@(traduci($"{CurrItem.AppName}-LIST"))
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-3 text-secondary">
|
||||
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
||||
</div>
|
||||
<div class="col-9 text-secondary" style="overflow-y: auto; height: 8em;">
|
||||
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
||||
<ul style="mb-0">
|
||||
@(traduci($"{CurrItem.AppName}-LIST"))
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-danger py-1">
|
||||
@if (authOk())
|
||||
{
|
||||
<span class="text-success">Programma Attivato</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-danger">Licenza non attivata!</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public UpdMan CurrItem { get; set; }
|
||||
|
||||
protected bool authOk()
|
||||
{
|
||||
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey) && Convert.ToBoolean(CurrItem.IsAuth);
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string fullUrl(string relUrl)
|
||||
{
|
||||
return $"{Configuration["BaseUrl"]}{relUrl}";
|
||||
}
|
||||
|
||||
protected MarkupString traduci(string lemma)
|
||||
{
|
||||
MarkupString answ;
|
||||
string rawHtml = DataService.Traduci(lemma, "IT");
|
||||
answ = new MarkupString(rawHtml);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,6 @@
|
||||
<div class="card-body px-3">
|
||||
<div class="row">
|
||||
<div class="col-6 col-md-4">
|
||||
@*<img src="@Url.Action("QR", new { valore = @ViewBag.BaseUrl + "MatrOpr=" + @item.MatrOpr + "&UserAuthKey=" + item.authKey })" alt="Image 12345" class="img-fluid" />*@
|
||||
<div id="qrCodeImg_@(CurrItem.MatrOpr)"></div>
|
||||
</div>
|
||||
<div class="col-6 col-md-8">
|
||||
|
||||
@@ -40,60 +40,7 @@
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
<div class="col-4 mb-2">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@if (authOk(item))
|
||||
{
|
||||
<a target="_blank" href="@(fullUrl(item.AppUrl))" class="text-info" title="Apri">
|
||||
<h3 class="mb-0">@item.AppName <i class="fas fa-link"></i></h3>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<del>
|
||||
<h3 class="mb-0 text-secondary">@item.AppName</h3>
|
||||
</del>
|
||||
}
|
||||
</div>
|
||||
<div class="card-body pb-0">
|
||||
<div class="row">
|
||||
@if (authOk(item))
|
||||
{
|
||||
<div class="col-3 text-info">
|
||||
<i class="@(traduci($"{item.AppName}-ICON"))"></i>
|
||||
</div>
|
||||
<div class="col-9" style="overflow-y: auto; height: 8em;">
|
||||
<b>@(traduci($"{item.AppName}-TITLE"))</b>
|
||||
<ul style="mb-0">
|
||||
@(traduci($"{item.AppName}-LIST"))
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-3 text-secondary">
|
||||
<i class="@(traduci($"{item.AppName}-ICON"))"></i>
|
||||
</div>
|
||||
<div class="col-9 text-secondary" style="overflow-y: auto; height: 8em;">
|
||||
<b>@(traduci($"{item.AppName}-TITLE"))</b>
|
||||
<ul style="mb-0">
|
||||
@(traduci($"{item.AppName}-LIST"))
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-danger py-1">
|
||||
@if (authOk(item))
|
||||
{
|
||||
<span class="text-success">Programma Attivato</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-danger">Licenza non attivata!</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<HomeLink CurrItem="@item"></HomeLink>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -26,9 +26,6 @@ namespace MP.Land.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; }
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
@@ -45,24 +42,11 @@ namespace MP.Land.Pages
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected bool authOk(UpdMan currItem)
|
||||
{
|
||||
bool answ = !string.IsNullOrEmpty(currItem.LicenseKey) && Convert.ToBoolean(currItem.IsAuth);
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected string fullUrl(string relUrl)
|
||||
{
|
||||
return $"{Configuration["BaseUrl"]}{relUrl}";
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
AppMService.ShowSearch = false;
|
||||
AppMService.PageName = "Home";
|
||||
AppMService.PageIcon = "fas fa-home pr-2";
|
||||
//AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||
//AppMService.EA_FilterUpdated += OnFilterUpdated;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -87,16 +71,6 @@ namespace MP.Land.Pages
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected MarkupString traduci(string lemma)
|
||||
{
|
||||
MarkupString answ;
|
||||
//string rawHtml = "<li>primo</li><li>secondo</li>";
|
||||
string rawHtml = DataService.Traduci(lemma, "IT");
|
||||
answ = new MarkupString(rawHtml);
|
||||
// cerco nella cache Redis
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user