198 lines
13 KiB
Plaintext
198 lines
13 KiB
Plaintext
<div class="row">
|
|
<div class="@mainCss">
|
|
<div class="card shadow">
|
|
<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 (TypeSel != MP.TaskMan.Objects.Enums.Task2ExeType.ND)
|
|
{
|
|
@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>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-outline-secondary">Sel →</button>
|
|
}
|
|
<select class="form-select" @bind="@TypeSel">
|
|
@foreach (var option in Enum.GetValues(typeof(MP.TaskMan.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>Ord</th>
|
|
<th>Task</th>
|
|
<th>Tipo</th>
|
|
@if (detRecord == null)
|
|
{
|
|
<th>Command</th>
|
|
}
|
|
<th>Sched.</th>
|
|
@if (detRecord == null)
|
|
{
|
|
<th class="text-end">Last</th>
|
|
<th class="text-end">Next</th>
|
|
<th class="text-end">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)">
|
|
<td class="text-nowrap">
|
|
<button class="btn btn-sm btn-info" @onclick="()=>DoSelect(record)" title="Select"><i class="fas fa-search"></i></button>
|
|
@if (detRecord == null)
|
|
{
|
|
@if (currRecord == null)
|
|
{
|
|
<button class="btn btn-sm btn-primary ms-1" @onclick="()=>DoEdit(record)" title="Edit"><i class="fas fa-pencil-alt"></i></button>
|
|
<button class="btn btn-sm btn-success" @onclick="()=>DoClone(record)" title="Clona"><i class="fas fa-magic"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-secondary ms-1" @onclick="()=>DoCancel()" title="Cancel"><i class="fas fa-undo"></i></button>
|
|
}
|
|
}
|
|
</td>
|
|
<td class="text-nowrap">
|
|
@if (detRecord == null)
|
|
{
|
|
@if (record.Ordinal == minOrdinal)
|
|
{
|
|
<button class="btn btn-sm btn-outline-secondary mx-1" disabled title="Cannot Move"><i class="fas fa-caret-up"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-outline-primary mx-1" @onclick="()=>DoMove(record, true)" title="Move Up"><i class="fas fa-caret-up"></i></button>
|
|
}
|
|
}
|
|
<b>@record.Ordinal</b>
|
|
@if (detRecord == null)
|
|
{
|
|
@if (record.Ordinal == maxOrdinal)
|
|
{
|
|
<button class="btn btn-sm btn-outline-secondary mx-1" disabled title="Cannot Move"><i class="fas fa-caret-down"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-outline-primary mx-1" @onclick="()=>DoMove(record, false)" title="Move Down"><i class="fas fa-caret-down"></i></button>
|
|
}
|
|
}
|
|
</td>
|
|
<td class="text-nowrap @checkDis(@record)">
|
|
<div>@record.Name</div>
|
|
<div class="small text-truncate">@record.Descript</div>
|
|
</td>
|
|
<td class="@checkDis(@record)">
|
|
@record.TType
|
|
</td>
|
|
@if (detRecord == null)
|
|
{
|
|
<td class="small text-truncate text-break @checkDis(@record)">
|
|
<div class="font-monospace fw-bold" title="@record.Command">@TextReduce(record.Command, 32)</div>
|
|
<div class="small text-break" title="@record.Args">@TextReduce(record.Args, 40)</div>
|
|
</td>
|
|
}
|
|
<td>@record.Freq × @record.Cad</td>
|
|
@if (detRecord == null)
|
|
{
|
|
<td class="text-end text-nowrap @checkDis(@record)">
|
|
<div>@($"{record.DtLastExec:yyyy-MM-dd}")</div>
|
|
<div class="small">@($"{record.DtLastExec:ddd HH:mm:ss}")</div>
|
|
</td>
|
|
<td class="text-end text-nowrap @checkDis(@record)">
|
|
<div>@($"{record.DtNextExec:yyyy-MM-dd}")</div>
|
|
<div class="small">@($"{record.DtNextExec:ddd HH:mm:ss}")</div>
|
|
</td>
|
|
<td class="text-end @checkDis(@record)">
|
|
<b>@($"{record.LastDuration:N3}")</b> <sub>sec</sub> <button class="btn btn-sm @btnCss(record)" @onclick="() => ToggleDetail(record)" title="Ultima esecuzione"><i class="far @iconCss(record)"></i></button>
|
|
</td>
|
|
<td>
|
|
@if(record.Enabled)
|
|
{
|
|
<button class="btn btn-sm @btnRunCss(record.DtNextExec) me-1" @onclick="()=>DoRun(record)" title="Run Now"><i class="fas fa-play"></i></button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-secondary me-1" title="Disabled / Cannot run!" disabled><i class="fas fa-play"></i></button>
|
|
}
|
|
</td>
|
|
}
|
|
</tr>
|
|
@if (DetailTaskId != null && DetailTaskId.TaskId == record.TaskId)
|
|
{
|
|
<tr>
|
|
<td colspan="10 @checkDis(@record)">
|
|
<div class="d-flex justify-content-end">
|
|
<div class="p-1 small alert @alCss(record)">
|
|
<pre>@record.LastResult</pre>
|
|
</div>
|
|
</div>
|
|
</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>
|
|
|