137 lines
3.6 KiB
Plaintext
137 lines
3.6 KiB
Plaintext
<div class="row">
|
|
<div class="col-12 my-1">
|
|
<ol class="list-group">
|
|
<li class="list-group-item align-items-lg-start bg-success text-light d-flex justify-content-between">
|
|
<div class="px-0">Job Eseguiti</div>
|
|
@if (QueueAll.Count > 0 && EnableReset)
|
|
{
|
|
<div class="px-0">
|
|
<button class="btn btn-sm btn-warning" @onclick="() => ResetQueue()">Reset All <i class="fa-solid fa-arrow-turn-up"></i></button>
|
|
</div>
|
|
}
|
|
</li>
|
|
@if (QueuePaged == null || QueuePaged?.Count() == 0)
|
|
{
|
|
<li class="list-group-item align-items-lg-start">Nessun Job Eseguito!</li>
|
|
}
|
|
else
|
|
{
|
|
foreach (var item in QueuePaged)
|
|
{
|
|
<li class="list-group-item align-items-lg-start">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-0">
|
|
@item
|
|
</div>
|
|
<div class="px-0">
|
|
<button class="btn btn-sm btn-primary" @onclick="() => ReRunJob(item)"><i class="fa-solid fa-share-from-square" title="Riesecuzione Estimate"></i> Re-Run</button>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
}
|
|
}
|
|
</ol>
|
|
@if (totalCount >= numRecord)
|
|
{
|
|
<nav>
|
|
<EgwCoreLib.Razor.DataPager currPage="@currPage" PageSize="@numRecord" totalCount="@totalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
|
|
</nav>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public EventCallback<string> EC_ReRunJob { get; set; }
|
|
|
|
[Parameter]
|
|
public EventCallback<string> EC_ResetQueue { get; set; }
|
|
|
|
[Parameter]
|
|
public List<string> QueueAll { get; set; } = new List<string>();
|
|
|
|
[Parameter]
|
|
public string QueueType { get; set; } = "Run";
|
|
|
|
[Parameter]
|
|
public bool EnableReset { get; set; } = false;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
UpdateTable();
|
|
}
|
|
|
|
protected async Task ReRunJob(string? JobCode)
|
|
{
|
|
await EC_ReRunJob.InvokeAsync(JobCode);
|
|
}
|
|
|
|
protected async Task ResetQueue()
|
|
{
|
|
await EC_ResetQueue.InvokeAsync(QueueType);
|
|
}
|
|
|
|
|
|
protected void SaveNumRec(int newNum)
|
|
{
|
|
numRecord = newNum;
|
|
UpdateTable();
|
|
}
|
|
|
|
protected void SavePage(int newNum)
|
|
{
|
|
currPage = newNum;
|
|
UpdateTable();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
/// <summary>
|
|
/// pagina attuale
|
|
/// </summary>
|
|
private int currPage = 1;
|
|
|
|
/// <summary>
|
|
/// elementi per pagina
|
|
/// </summary>
|
|
private int numRecord = 10;
|
|
|
|
/// <summary>
|
|
/// Numero tot records
|
|
/// </summary>
|
|
private int totalCount = 0;
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
private IEnumerable<string>? QueuePaged { get; set; } = null;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
/// <summary>
|
|
/// Filtro e paginazione
|
|
/// </summary>
|
|
private void UpdateTable()
|
|
{
|
|
// fix paginazione
|
|
QueuePaged = QueueAll
|
|
.Skip(numRecord * (currPage - 1))
|
|
.Take(numRecord);
|
|
totalCount = QueueAll.Count();
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|