139 lines
7.9 KiB
Plaintext
139 lines
7.9 KiB
Plaintext
@page "/TaskScheduler"
|
|
|
|
<div class="row">
|
|
<div class="@mainCss">
|
|
<div class="card">
|
|
<div class="card-header table-primary p-1">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-2">
|
|
<b class="fs-4">TaskList</b>
|
|
</div>
|
|
<div class="px-2">
|
|
<div class="input-group">
|
|
@if (currRecord == null)
|
|
{
|
|
<button class="btn btn-success" @onclick="addNew" title="Add New"><i class="fas fa-plus"></i> Add New</button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-secondary" @onclick="doCancel" title="Cancel"><i class="fas fa-undo"></i> Cancel</button>
|
|
}
|
|
<select class="form-select" @bind="@TypeSel">
|
|
@foreach (var option in Enum.GetValues(typeof(MP.Data.Objects.Enums.Task2ExeType)))
|
|
{
|
|
<option value="@option">
|
|
@option
|
|
</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<TaskEdit CurrRecord="@currRecord" EC_update="forceUpdate"></TaskEdit>
|
|
</div>
|
|
<div class="card-body py-0 px-1">
|
|
@if (isLoading)
|
|
{
|
|
<ProgressDisplay DisplaySize="ProgressDisplay.ModalSize.Medium" ExpTimeMSec="@expTimeMsec" CurrVal="@currVal" NextVal="@nextVal" MaxVal="@MaxVal" Title="Task Processing" RefreshInterval="200"></ProgressDisplay>
|
|
<LoadingData Title="Elaborazione..." DisplayMode="LoadingData.SpinMode.BounceLine" DisplaySize="LoadingData.CtrlSize.Large"></LoadingData>
|
|
}
|
|
else if (ListRecords == null)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else if (totalCount == 0)
|
|
{
|
|
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<table class="table table-sm table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
<button class="btn btn-sm btn-info" @onclick="doReset" title="Reset"><i class="fas fa-sync"></i></button>
|
|
</th>
|
|
<th>#</th>
|
|
<th>Task</th>
|
|
<th>Tipo</th>
|
|
<th>Command</th>
|
|
<th>Schedulazione</th>
|
|
@if (detRecord == null)
|
|
{
|
|
<th class="text-right">Last</th>
|
|
<th class="text-right">Next</th>
|
|
<th class="text-right">Result</th>
|
|
}
|
|
<th>
|
|
<button class="btn btn-sm btn-danger me-1" @onclick="forceAll" title="Force All"><i class="fas fa-play"></i></button>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var record in ListRecords)
|
|
{
|
|
<tr class="@checkSelect(@record.TaskId)">
|
|
<td>
|
|
<button class="btn btn-sm btn-info me-1" @onclick="()=>doSelect(record)" title="Select"><i class="fas fa-search"></i></button>
|
|
@if (currRecord == null)
|
|
{
|
|
<button class="btn btn-sm btn-primary me-1" @onclick="()=>doEdit(record)" title="Edit"><i class="fas fa-pencil-alt"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-secondary" @onclick="()=>doCancel()" title="Cancel"><i class="fas fa-undo"></i></button>
|
|
}
|
|
</td>
|
|
<td>@record.TaskId</td>
|
|
<td>
|
|
<div>@record.Name</div>
|
|
<div class="small">@record.Descript</div>
|
|
</td>
|
|
<td>
|
|
@record.TType
|
|
</td>
|
|
<td>
|
|
<div>@record.Command</div>
|
|
<div class="small">@record.Args</div>
|
|
</td>
|
|
<td>@record.Freq × @record.Cad</td>
|
|
@if (detRecord == null)
|
|
{
|
|
<td class="text-right">
|
|
<div>@($"{record.DtLastExec:yyyy-MM-dd}")</div>
|
|
<div class="small">@($"{record.DtLastExec:ddd HH:mm:ss}")</div>
|
|
</td>
|
|
<td class="text-right">
|
|
<div>@($"{record.DtNextExec:yyyy-MM-dd}")</div>
|
|
<div class="small">@($"{record.DtNextExec:ddd HH:mm:ss}")</div>
|
|
</td>
|
|
<td class="text-right">
|
|
<div>@record.LastDuration.ToString("N3") sec</div>
|
|
<div class="small">@record.LastResult</div>
|
|
</td>
|
|
}
|
|
<td>
|
|
<button class="btn btn-sm @btnRunCss(record.DtNextExec) me-1" @onclick="()=>doRun(record)" title="Run Now"><i class="fas fa-play"></i></button>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="card-footer py-1">
|
|
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" exportEnabled="false" exportRequested="ExportCsv" fileName="@fileName" totalCount="totalCount" showLoading="isLoading" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@if (detRecord != null && !isLoading)
|
|
{
|
|
<div class="col-6">
|
|
<TaskExeList CurrRecord="detRecord"></TaskExeList>
|
|
</div>
|
|
}
|
|
</div> |