diff --git a/GWMS.UI/Components/Diagnostics.razor b/GWMS.UI/Components/Diagnostics.razor index 8c45d6e..88f70e0 100644 --- a/GWMS.UI/Components/Diagnostics.razor +++ b/GWMS.UI/Components/Diagnostics.razor @@ -11,42 +11,22 @@
@if (!(DbUserOk && DbIdentity)) { -
- App Setup -
-
- -
-
- -
- @if (ShowSetup) - { - - } +
} - @if (!DbLogOk) + else if (!DbLogOk) { -
- Sim Data -
-
- -
-
- -
- @if (ShowSim) - { - - } + +
+ } + @if (processRunning) + { +
+
+
+
}
@@ -59,14 +39,25 @@ protected bool DbLogOk { get; set; } = false; protected bool DbAllOk { get; set; } = false; protected bool DbIdentity { get; set; } = false; - protected bool ShowSim { get; set; } = false; - protected bool ShowSetup { get; set; } = false; + protected bool processRunning { get; set; } = false; protected override async Task OnInitializedAsync() { + processRunning = false; await ReloadData(); } + protected async Task Processing() + { + processRunning = true; + await ReloadData(); + } + + protected async Task Done() + { + processRunning = false; + await ReloadData(); + } protected async Task ReloadData() { var resultUser = await Health.Checks.DbUserApp(DbConfig.DATABASE_NAME); @@ -78,14 +69,4 @@ DbAllOk = (DbUserOk && DbLogOk && DbIdentity); } - protected async void toggleSim() - { - ShowSim = !ShowSim; - await ReloadData(); - } - protected async void toggleSetup() - { - ShowSetup = !ShowSetup; - await ReloadData(); - } } \ No newline at end of file diff --git a/GWMS.UI/Components/MigrationManager.razor b/GWMS.UI/Components/MigrationManager.razor index e1dcf05..b094a56 100644 --- a/GWMS.UI/Components/MigrationManager.razor +++ b/GWMS.UI/Components/MigrationManager.razor @@ -9,47 +9,44 @@ @if (!DbAllOk) {
-
-

DB Init

+
+

DB Init

@if (!DbUserOk) {
} - @if (!DbIdentity) + else if (!DbIdentity) {
-
} - @if (processRunning) - { -
- -
- }
} @code { - protected bool processRunning { get; set; } = false; + [Parameter] + public EventCallback evRefresh { get; set; } + [Parameter] + public EventCallback evProcessing { get; set; } protected async Task initDb() { if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler effettuare inizializzazione/migrazione DB?")) return; - processRunning = true; + reportProcess(); await DbAdmin.migrateDbMain(); await ReloadData(); - processRunning = false; + reportChange(); } protected async Task initIdent() @@ -57,10 +54,10 @@ if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler effettuare inizializzazione/migrazione servizi Identity?")) return; - processRunning = true; + reportProcess(); await DbAdmin.migrateDbIdentity(); await ReloadData(); - processRunning = false; + reportChange(); } protected bool DbUserOk { get; set; } = false; @@ -81,4 +78,14 @@ DbAllOk = (DbUserOk && DbIdentity); } + private void reportChange() + { + evRefresh.InvokeAsync(1); + } + + private void reportProcess() + { + evProcessing.InvokeAsync(1); + } + } \ No newline at end of file diff --git a/GWMS.UI/Components/SetupSim.razor b/GWMS.UI/Components/SetupSim.razor index be25bb9..2db90ab 100644 --- a/GWMS.UI/Components/SetupSim.razor +++ b/GWMS.UI/Components/SetupSim.razor @@ -5,56 +5,73 @@ @inject MessageService AppMService @inject IJSRuntime JSRuntime -
-
-

Simulazione

+
+
+

Simulazione

-
-
-
- giorni +
+
+
+
+
+ giorni +
+ +
- -
-
-
-
-
- step +
+
+
+ step +
+ +
- -
-
-
-
-
- cons orario max +
+
+
+ cons orario max +
+ +
+
+
+
-
-
- -
@code { + + [Parameter] + public EventCallback evRefresh { get; set; } + [Parameter] + public EventCallback evProcessing { get; set; } + protected int numDays { get; set; } = 7; protected int stepMin { get; set; } = 30; protected int maxHourRate { get; set; } = 800; - protected bool processRunning { get; set; } = false; - protected async Task resetDB() { - if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler risimulare l'intero set di dati?")) + if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler risimulare il set di dati di Log?")) return; - processRunning = true; + reportProcess(); DataService.RegenDB(numDays, stepMin, maxHourRate); - processRunning = false; + reportChange(); } + private void reportChange() + { + evRefresh.InvokeAsync(1); + } + + private void reportProcess() + { + evProcessing.InvokeAsync(1); + } } \ No newline at end of file diff --git a/GWMS.UI/Pages/WeekPlan.razor b/GWMS.UI/Pages/WeekPlan.razor index ab2a8af..9a0f8aa 100644 --- a/GWMS.UI/Pages/WeekPlan.razor +++ b/GWMS.UI/Pages/WeekPlan.razor @@ -22,10 +22,6 @@ { } - else if (totalCount == 0) - { -
Nessun record trovato
- } else {