diff --git a/MP.Data/Controllers/MpStatsController.cs b/MP.Data/Controllers/MpStatsController.cs index 40aa264f..a1367daa 100644 --- a/MP.Data/Controllers/MpStatsController.cs +++ b/MP.Data/Controllers/MpStatsController.cs @@ -190,6 +190,7 @@ namespace MP.Data.Controllers // aggiorno record chiamata... currRec.DtLastExec = dtStart; currRec.LastResult = resRec.Result; + currRec.LastIsError=resRec.IsError; currRec.LastDuration = dtEnd.Subtract(dtStart).TotalSeconds; // calcolo prossima esecuzione... currRec.DtNextExec = CalcNextExe(currRec); diff --git a/MP.Data/DatabaseModels/TaskListModel.cs b/MP.Data/DatabaseModels/TaskListModel.cs index 1b36175a..cef8afad 100644 --- a/MP.Data/DatabaseModels/TaskListModel.cs +++ b/MP.Data/DatabaseModels/TaskListModel.cs @@ -72,6 +72,11 @@ namespace MP.Data.DatabaseModels /// public double LastDuration { get; set; } = 0; + /// + /// Esito ultima esecuzione in Errore + /// + public bool LastIsError { get; set; } = false; + /// /// Ultimo risultato registrato /// diff --git a/MP.Stats/Components/TLResult.razor b/MP.Stats/Components/TLResult.razor new file mode 100644 index 00000000..bbe15467 --- /dev/null +++ b/MP.Stats/Components/TLResult.razor @@ -0,0 +1,7 @@ +
+ @CurrRecord.LastDuration.ToString("N3") sec +
+@if (showDetail) +{ +
@CurrRecord.LastResult
+} diff --git a/MP.Stats/Components/TLResult.razor.cs b/MP.Stats/Components/TLResult.razor.cs new file mode 100644 index 00000000..60fff6f3 --- /dev/null +++ b/MP.Stats/Components/TLResult.razor.cs @@ -0,0 +1,56 @@ +using Microsoft.AspNetCore.Components; +using MP.Data.DatabaseModels; +using System.Threading.Tasks; + +namespace MP.Stats.Components +{ + public partial class TLResult + { + #region Public Properties + + [Parameter] + public TaskListModel CurrRecord { get; set; } = null!; + + #endregion Public Properties + + #region Protected Properties + + protected string alCss + { + get => CurrRecord.LastIsError ? "alert-danger" : "alert-success"; + } + + protected string btnCss + { + get + { + string answ = showDetail ? "btn-" : "btn-outline-"; + answ += CurrRecord.LastIsError ? "danger" : "success"; + return answ; + } + } + + protected string iconCss + { + get => CurrRecord.LastIsError ? "fa-thumbs-down" : "fa-thumbs-up"; + } + + #endregion Protected Properties + + #region Protected Methods + + protected async Task toggleDetail() + { + showDetail = !showDetail; + await InvokeAsync(StateHasChanged); + } + + #endregion Protected Methods + + #region Private Properties + + private bool showDetail { get; set; } = false; + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/MP.Stats/MP.Stats.csproj b/MP.Stats/MP.Stats.csproj index 42dc4420..aaab9c87 100644 --- a/MP.Stats/MP.Stats.csproj +++ b/MP.Stats/MP.Stats.csproj @@ -4,8 +4,8 @@ net6.0 MP.Stats 826e877c-ba70-4253-84cb-d0b1cafd4440 - 6.16.2404.0311 - 6.16.2404.0311 + 6.16.2404.0312 + 6.16.2404.0312 diff --git a/MP.Stats/Pages/TaskScheduler.razor b/MP.Stats/Pages/TaskScheduler.razor index ae3e8fa0..91c74492 100644 --- a/MP.Stats/Pages/TaskScheduler.razor +++ b/MP.Stats/Pages/TaskScheduler.razor @@ -62,9 +62,9 @@ Schedulazione @if (detRecord == null) { - Last - Next - Result + Last + Next + Result } @@ -75,7 +75,7 @@ @foreach (var record in ListRecords) { - + @if (currRecord == null) { @@ -86,7 +86,7 @@ } - + @if (record.Ordinal == minOrdinal) { @@ -105,7 +105,7 @@ } - +
@record.Name
@record.Descript
@@ -119,17 +119,16 @@ @record.Freq × @record.Cad @if (detRecord == null) { - +
@($"{record.DtLastExec:yyyy-MM-dd}")
@($"{record.DtLastExec:ddd HH:mm:ss}")
- +
@($"{record.DtNextExec:yyyy-MM-dd}")
@($"{record.DtNextExec:ddd HH:mm:ss}")
- -
@record.LastDuration.ToString("N3") sec
-
@record.LastResult
+ + } diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html index 2b9ffd5f..47f63535 100644 --- a/MP.Stats/Resources/ChangeLog.html +++ b/MP.Stats/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

Versione: 6.16.2404.0311

+

Versione: 6.16.2404.0312


Note di rilascio: