Files
mapo-core/MP.Prog/Pages/Archive.razor
T
Samuele Locatelli 37e54bc587 PROG
- Fix gerstione revisioni x Del / Appr
2024-10-29 09:04:58 +01:00

235 lines
14 KiB
Plaintext

@page "/Archive"
<div class="card shadow">
<div class="card-header table-primary">
<div class="d-flex justify-content-between">
<div class="px-0">
<h4>Elenco Programmi</h4>
<div class="form-group mb-0">
<button class="btn btn-outline-warning btn-sm" @onclick="() => ForceCheck(30)" title="Analisi Modifiche ultimi 30gg">
<i class="fas fa-sync-alt"></i> Update (30gg) <i class="far fa-folder-open"></i>
</button>
@if (OnlyMod && totalCount >= 0)
{
<button class="btn btn-success btn-sm ms-1" @onclick="MassAppr" title="Approva tutte le modifiche visualizzate">
<i class="fas fa-sync-alt"></i> Approva Mod. vis. <i class="fa-solid fa-clipboard-check"></i>
</button>
}
</div>
</div>
<div class="px-0 text-end">
<div class="d-flex flex-row-reverse">
<div class="px-0">
<div class="input-group">
<span class="input-group-text">
<span class="fas fa-industry" aria-hidden="true"></span>
</span>
<select @bind="@SelIdxMacc" class="form-select form-select-sm">
@if (MacList != null)
{
foreach (var item in MacList)
{
<option value="@item.IdxMacchina">@item.Descrizione (@item.RuleName)</option>
}
}
</select>
<button id="btnReset" class="btn btn-info btn-sm" @onclick="() => ResetFilter()" title="Reset Filter"><span class="oi oi-loop-circular"></span></button>
</div>
</div>
<div class="px-1">
<div class="form-check form-switch small">
<input class="form-check-input" type="checkbox" role="switch" title="Solo Aperti / Mostra tutti" @bind-value="@OnlyMod" checked="@OnlyMod">
<label class="form-check-label">Mod</label>
</div>
</div>
<div class="px-1">
<div class="form-check form-switch small">
<input class="form-check-input" type="checkbox" role="switch" title="Solo Attivi / Mostra tutti" @bind-value="@OnlyActive" checked="@OnlyActive">
<label class="form-check-label">Attivi</label>
</div>
</div>
<div class="px-1">
<div class="form-check form-switch small">
<input class="form-check-input" type="checkbox" role="switch" title="Solo Senza Tag / Mostra tutti" @bind-value="@OnlyNoTag" checked="@OnlyNoTag">
<label class="form-check-label">No Tag</label>
</div>
</div>
</div>
<div class="d-flex mt-1 justify-content-between">
<div class="px-0 text-truncate">
@if (!string.IsNullOrEmpty(SelFileName))
{
<button class="btn btn-sm btn-secondary py-0 me-1" title="@SelFileName" @onclick="FilterPathRemove">@TextReduce(SelFileName, 25) <i class="fa-solid fa-xmark"></i></button>
}
@if (!string.IsNullOrEmpty(SelUserName))
{
<button class="btn btn-sm btn-dark text-light py-0" title="@SelUserName" @onclick="FilterUserNameRemove">@TextReduce(SelUserName, 20) <i class="fa-solid fa-xmark"></i></button>
}
</div>
<div class="px-0">
<div class="input-group input-group-sm">
<span class="input-group-text">Tags</span>
<button type="button" class="btn btn-sm btn-primary" @onclick="() => OpenDialog()" title="Aggiunta Tag">
<i class="fas fa-search"></i>
</button>
<div class="form-control form-control-sm" style="min-width: 6rem;">
@if (!string.IsNullOrEmpty(SelTag))
{
<span class="badge text-bg-info">@SelTag</span>
}
</div>
<div class="input-group-append">
<button type="button" class="btn btn-sm btn-secondary" @onclick="() => ResetTag()" title="Reset Tag">
<i class="fas fa-xmark"></i>
</button>
</div>
</div>
@if (DeleteDialogOpen)
{
<TagSearch Title="Ricerca Tag" OnClose="@OnDialogClose"></TagSearch>
}
</div>
</div>
</div>
</div>
</div>
<div class="card-body p-1">
@if (currRecord != null)
{
<FileEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" TagList="@TagList" MacList="@MacList" ReqRev="@ReqRevDx"></FileEditor>
}
@if (ListRecords == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="@mainCol">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th>
@if (currRecord != null)
{
<button class="btn btn-sm btn-primary" @onclick="ResetData" title="Chiudi">
<i class="fas fa-times"></i>
</button>
}
</th>
<th>File</th>
<th class="text-center">Rev</th>
@if (currRecord == null || currRecord.Rev == 0)
{
<th class="text-center">Size / User</th>
}
<th>Macchina</th>
<th>Tags</th>
@if (currRecord == null || currRecord.Rev == 0)
{
<th class="text-end">Modificato</th>
<th></th>
}
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.FileId)">
<td class="text-nowrap">
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record #@record.FileId"><i class="fa-solid fa-magnifying-glass"></i></button>
</td>
<td>
<div class="@(cssActive(record.Active))">
<div>@record.Name</div>
<button class="btn btn-sm btn-outline-secondary px-1 py-0" @onclick="() => FilterPath(record.Path)" title="@record.Path">
<i class="fa-regular fa-file-lines"></i>
<span class="small text-truncate">@TextReduce(record.Path, 40)</span>
</button>
</div>
</td>
<td class="text-center">
@record.Rev
<div>
<span title="@record.DiskStatus | Ultimo controllo: @record.LastCheck.ToString("yyyy.MM.dd HH:mm:ss")">
<span class="@(cssStatusByCod(record.DiskStatus))">
@record.DiskStatus
</span>
</span>
</div>
</td>
@if (currRecord == null || currRecord.Rev == 0)
{
<td class="text-center px-1" style="width: 8rem;">
<div class="text-end px-3">
@CalcSize(record.Size)
</div>
<div class="text-end small">
@if (!string.IsNullOrEmpty(record.UserAppr))
{
<button class="btn btn-sm btn-outline-dark px-1 py-0" title="Filtra Utente" @onclick="() => FilterUserName(record.UserAppr)">
<i class="fas fa-user-alt"></i>
<span class="small">@record.UserAppr</span>
</button>
}
else
{
<button class="btn btn-sm btn-primary border border-info border-2 rounded px-2 py-0" title="Forza approvazione Release" @onclick="() => FileSetUserApp(record)">
<i class="fas fa-user-alt"></i>
Approva
<i class="fas fa-floppy-disk"></i>
</button>
}
</div>
</td>
}
<td>
<div>@record.Macchina.Nome</div>
<div class="small">@record.Macchina.Descrizione</div>
</td>
<td class="small" style="max-width: 30rem;">
@foreach (var item in record.Tags)
{
<button class="btn btn-sm btn-outline-info px-1 py-0 me-1" @onclick="() => FilterTag(item.TagId)" title="Filtra Tag">
<div class="small">@item.TagId</div>
</button>
}
</td>
@if (currRecord == null || currRecord.Rev == 0)
{
<td class="text-end">
<div>@record.LastMod.ToString("yyyy.MM.dd")</div>
<div class="small">@record.LastMod.ToString("ddd HH:mm.ss")</div>
</td>
<td class="text-end">
@if (string.IsNullOrEmpty(record.UserAppr))
{
<button class="btn btn-sm btn-danger " @onclick="() => DeleteRec(record)" title="Elimina Record"><i class="fa-solid fa-trash"></i></button>
}
</td>
}
</tr>
}
</tbody>
</table>
</div>
@if (currRecord != null && currRecord.Rev > 0)
{
<div class="col-3">
<RevList CurrRec="@currRecord" EC_selRev="SelRev" EC_reqAppr="FileSetUserApp" EC_reqDelete="DeleteRec"></RevList>
</div>
}
</div>
}
</div>
<div class="card-footer py-0 px-1">
<EgwCoreLib.Razor.DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="SetRecPage" numPageChanged="SetNumPage" totalCount="totalCount" showLoading="isLoading"></EgwCoreLib.Razor.DataPager>
</div>
</div>