Files
limanapp/EgwControlCenter.App/Components/Compo/ApplicationCheck.razor
T
Samuele Locatelli ab211bc75c ACC:
- Prima e seconda vers ClickOnce
- fix deploy senza js di fontawesome
- continuo test deploy
2024-09-23 11:08:50 +02:00

94 lines
2.6 KiB
Plaintext

@using EgwControlCenter.Core
@using EgwControlCenter.Core.Models
@inject AppControlService ACService
<table class="table table-striped table-sm text-start shadow border">
<thead>
<tr class="bg-dark bg-gradient text-light">
@* <th class="text-center" style="width: 2rem;">
<button class="btn btn-primary btn-sm" @onclick="DoCancel"><i class="fa-solid fa-rotate"></i></button>
</th> *@
<th>Applicazione</th>
<th>Installed</th>
<th>Available</th>
@* <th class="text-center">Update</th> *@
<th class="text-end">Note</th>
</tr>
</thead>
<tbody>
@if (ListRecords == null || ListRecords.Count == 0)
{
<tr>
<td colspan="5">
<div class="alert alert-warning">Nessun aggiornamento disponibile!</div>
</td>
</tr>
}
else
{
@foreach (var item in ListRecords)
{
<tr>
<td>
@item.CodApp
@if (item.HasUpdate)
{
<i class="fa-solid fa-bell text-success mx-2"></i>
}
</td>
<td>@item.VersNumCurr</td>
<td>@item.VersNumLast</td>
@* <td class="text-center">
@if (item.HasUpdate)
{
<i class="fa-solid fa-bell text-success"></i>
}
</td> *@
<td>@item.RelTagsLast</td>
</tr>
}
}
</tbody>
</table>
@code {
[Parameter]
public bool OnlyUpdate { get; set; } = false;
private List<VersStatusDTO>? ListRecords { get; set; } = null;
private List<VersStatusDTO> CurrRecords
{
get => ACService.ListAppStatus;
// set => ACService.ListAppStatus = value;
}
protected override void OnParametersSet()
{
// fix parametro visualizzazione solo update
ForceReload();
}
protected override void OnInitialized()
{
ACService.EA_StatusUpdated += ACService_EA_StatusUpdated;
}
private void ACService_EA_StatusUpdated()
{
// fermo il timer e lo riavvio...
ForceReload();
}
private void ForceReload()
{
// ListRecords = null;
ListRecords = CurrRecords
.Where(x => x.HasUpdate || !OnlyUpdate)
.ToList();
StateHasChanged();
}
}