Files
Samuele Locatelli 5d72d21fb1 Stat installazioni:
Update gestione paginazione (visibile solo dove serve) + fix calcolo di alcuni intems male filtrati
2025-04-03 17:47:31 +02:00

144 lines
7.8 KiB
Plaintext

<div class="card shadow">
<div class="card-header">
<div class="d-flex justify-content-between">
<div class="p-0 d-flex">
<div class="px-0 d-flex">
<div class="px-0">
<h5>Remote Config</h5>
</div>
<div class="px-2">
<div class="input-group">
@if (string.IsNullOrEmpty(CodTipoApp))
{
<btn class="btn btn-sm btn-secondary disabled">Add New <i class="fa-solid fa-plus"></i></btn>
}
else
{
<btn class="btn btn-sm btn-success" @onclick="AddNewTarget">Add New <i class="fa-solid fa-plus"></i></btn>
}
<select @bind="@CodTipoApp" class="form-select form-select-sm">
@foreach (var item in Core.Enum.AppType)
{
<option value="@item.Key">@item.Value</option>
}
</select>
</div>
</div>
</div>
@if (RemoteCallActive)
{
<div class="px-2">
<i class="fa-solid fa-cloud-arrow-down fs-4 text-success"></i>
</div>
}
</div>
<div class="p-0 d-flex">
<div class="px-1">
<div class="input-group">
<button class="btn btn-sm btn-outline-success shadow" @onclick="DoSave" title="Save All Changes"><i class="fa-regular fa-floppy-disk"></i> Save</button>
<button class="btn btn-sm btn-outline-secondary shadow" @onclick="DoReset" title="Reset to Device Data"><i class="fa-solid fa-rotate"></i> Reset</button>
</div>
</div>
</div>
</div>
</div>
<div class="card-body py-0 px-2">
<div class="row py-0">
<div class="col-12 my-1">
@if (isLoading)
{
<LoadingData></LoadingData>
}
else
{
<table class="table table-striped table-sm text-start shadow border mb-0">
<thead>
<tr class="bg-dark bg-gradient text-light">
<th class="text-center" style="width: 6rem;"></th>
<th>App Type</th>
<th style="min-width: 16rem;">Path</th>
<th style="min-width: 8rem;">Search Pattern</th>
<th class="text-end" style="width: 3rem;">Enabled</th>
<th class="text-end" style="width: 3rem;">Update</th>
<th class="text-end" style="width: 3rem;"></th>
</tr>
</thead>
<tbody>
@foreach (var item in ListRecords)
{
<tr>
<td class="text-center">
@if (item.Idx == 1)
{
<button class="btn btn-sm btn-light text-secondary opacity-50 disabled"><i class="fa-solid fa-caret-up"></i></button>
}
else
{
<button class="btn btn-sm btn-light text-primary" title="Sposta in alto" @onclick="() => MoveUp(item)"><i class="fa-solid fa-caret-up"></i></button>
}
<span class="px-2">@item.Idx</span>
@if (item.Idx == totalCount)
{
<button class="btn btn-sm btn-light text-secondary opacity-50 disabled"><i class="fa-solid fa-caret-down"></i></button>
}
else
{
<button class="btn btn-sm btn-light text-primary" title="Sposta in basso" @onclick="() => MoveDown(item)"><i class="fa-solid fa-caret-down"></i></button>
}
</td>
<td style="width: 8rem;">
<select @bind="@item.ApplicationType" class="form-select form-select-sm">
@foreach (var iType in Core.Enum.AppType)
{
if (!string.IsNullOrEmpty(iType.Key))
{
<option value="@iType.Key">@iType.Value</option>
}
}
</select>
</td>
<td>
<input type="text" class="form-control form-control-sm" @bind="@item.BasePath" />
</td>
<td>
<input type="text" class="form-control form-control-sm" @bind="@item.SearchPattern" />
</td>
<td class="text-end">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" @bind="@item.IsEnabled">
</div>
</td>
<td class="text-end">
<div class="form-check form-switch">
@if (item.ApplicationType == "WinApp" || item.ApplicationType == "EgwACC")
{
<input class="form-check-input" type="checkbox" @bind="@item.UpdateEnabled">
}
else
{
<input class="form-check-input" type="checkbox" @bind="@item.UpdateEnabled" disabled>
}
</div>
</td>
<td class="text-end">
<button class="btn btn-sm btn-danger" title="Elimina record" @onclick="() => DeleteRec(item)"><i class="fa-solid fa-trash-can"></i></button>
</td>
</tr>
}
</tbody>
</table>
}
</div>
</div>
</div>
@if (totalCount > 5)
{
<div class="card-footer py-0 align-middle">
<EgwCoreLib.Razor.DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="@totalCount" showLoading="@isLoading"></EgwCoreLib.Razor.DataPager>
</div>
}
</div>