diff --git a/MP.WASM.Mon/Client/Pages/Counter.razor b/MP.WASM.Mon/Client/Pages/Counter.razor
deleted file mode 100644
index ef23cb31..00000000
--- a/MP.WASM.Mon/Client/Pages/Counter.razor
+++ /dev/null
@@ -1,18 +0,0 @@
-@page "/counter"
-
-Counter
-
-
Counter
-
-Current count: @currentCount
-
-
-
-@code {
- private int currentCount = 0;
-
- private void IncrementCount()
- {
- currentCount++;
- }
-}
diff --git a/MP.WASM.Mon/Client/Pages/FetchMSE.razor b/MP.WASM.Mon/Client/Pages/FetchMSE.razor
deleted file mode 100644
index 8ba48987..00000000
--- a/MP.WASM.Mon/Client/Pages/FetchMSE.razor
+++ /dev/null
@@ -1,46 +0,0 @@
-@page "/fetchmse"
-@using MP.Data
-@using MP.Data.DatabaseModels
-@inject HttpClient Http
-
-MP MON
-
-
- @if (listMSE == null)
- {
-
-
-
- }
- else if (listMSE.Count == 0)
- {
-
- }
- else
- {
- int currIdx = 0;
- foreach (var recordIob in listMSE)
- {
-
- currIdx++;
- if (currIdx >= maxCol)
- {
- currIdx = 0;
- @((MarkupString)"
");
- }
- }
- // controllo se devo "chiudere riga...
- int currNum = (currIdx % maxCol);
- while (currNum < (maxCol))
- {
- @((MarkupString)"
")
- ;
- currNum++;
-
- }
- }
-
diff --git a/MP.WASM.Mon/Client/Pages/FetchMSE.razor.cs b/MP.WASM.Mon/Client/Pages/FetchMSE.razor.cs
deleted file mode 100644
index 68d8a0a6..00000000
--- a/MP.WASM.Mon/Client/Pages/FetchMSE.razor.cs
+++ /dev/null
@@ -1,216 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Components;
-using System.Net.Http;
-using System.Net.Http.Json;
-using Microsoft.AspNetCore.Components.Forms;
-using Microsoft.AspNetCore.Components.Routing;
-using Microsoft.AspNetCore.Components.Web;
-using Microsoft.AspNetCore.Components.Web.Virtualization;
-using Microsoft.AspNetCore.Components.WebAssembly.Http;
-using Microsoft.JSInterop;
-using MP.WASM.Mon.Client;
-using MP.WASM.Mon.Client.Shared;
-using MP.WASM.Mon.Client.Components;
-using MP.Data;
-using MP.Data.Conf;
-using MP.Data.DatabaseModels;
-using NLog;
-
-namespace MP.WASM.Mon.Client.Pages
-{
- public partial class FetchMSE
- {
- private List? listMSE = null;
- private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
- private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
- private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
- protected int fastRefreshMs
- {
- get => 1000 * fastRefreshSec;
- }
- protected int slowRefreshMs
- {
- get => 1000 * slowRefreshSec;
- }
-
- protected bool doAnimate = true;
- protected int fastRefreshSec = 2;
- protected int keepAliveMin = 1;
- protected int maxCol = 6;
- protected string showArt = "";
- protected int slowRefreshSec = 300;
-
- public void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
- {
- var pUpd = Task.Run(async () =>
- {
- await ReloadData();
- await Task.Delay(1);
- Log.Trace("Elapsed Fast Timer");
- await InvokeAsync(StateHasChanged);
- });
- pUpd.Wait();
- }
-
- public async void ElapsedSlowTimer(object? source, System.Timers.ElapsedEventArgs e)
- {
- listMSE = null;
- await Task.Delay(1);
- Log.Trace("Elapsed Slow Timer");
-#if false
- NavManager.NavigateTo(NavManager.Uri);
-#endif
- }
-
- public void StartTimer()
- {
- // timer veloce
- fastTimer = new System.Timers.Timer(fastRefreshMs);
- fastTimer.Elapsed += ElapsedFastTimer;
- fastTimer.Enabled = true;
- fastTimer.Start();
- // timer lento
- slowTimer = new System.Timers.Timer(slowRefreshMs);
- slowTimer.Elapsed += ElapsedSlowTimer;
- slowTimer.Enabled = true;
- slowTimer.Start();
- }
-
- protected override async Task OnInitializedAsync()
- {
- await setupConf();
- await ReloadData();
- StartTimer();
- }
-
- private async Task ReloadData()
- {
-#if DEBUG
- // hack: legge 4 volte i dati x stressare sistema
- var singleData = await Http.GetFromJsonAsync>("api/MSE");
- listMSE = new List();
- for (int i = 0; i < 4; i++)
- {
- listMSE.AddRange(singleData);
- }
-#else
- listMSE = await Http.GetFromJsonAsync>("api/MSE");
-#endif
- }
-
- private async Task setupConf()
- {
-#if false
- CurrConfig = await MMDataService.ConfigGetAll();
- if (CurrConfig != null && CurrConfig.Count > 0)
- {
- // sistemo i parametri opzionali...
- getConfValInt("keepAliveMin", ref keepAliveMin);
- getConfValInt("MON_maxCol", ref maxCol);
- int intDoAnim = 0;
- getConfValInt("doAnimate", ref intDoAnim);
- doAnimate = intDoAnim == 1;
- getConfValInt("pageRefreshSec", ref slowRefreshSec);
- getConfValInt("MSE_cacheDuration", ref fastRefreshSec);
- getConfVal("sART", ref showArt);
- Log.Info($"Effettuato setup parametri | keepAlive: {keepAliveMin} | MaxCol: {maxCol} | doAnimate: {doAnimate} | slowRefreshSec: {slowRefreshSec} | fastRefreshSec: {fastRefreshSec}");
- }
-#endif
- }
-
- ///
- /// Recupera il valore e se trovato aggiorna
- ///
- /// Valore da cercare
- /// String in cui salvare il valore se trovato
- ///
- protected bool getConfVal(string chiave, ref string varObj)
- {
- bool answ = false;
-#if false
- if (CurrConfig != null && CurrConfig.Count > 0)
- {
- // sistemo i parametri opzionali...
- ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
- if (risultato != null)
- {
- varObj = risultato.Valore;
- answ = !string.IsNullOrEmpty(risultato.Valore);
- }
- }
-#endif
-
- return answ;
- }
-
- ///
- /// Recupera il valore e se trovato aggiorna
- ///
- /// Valore da cercare
- /// Int in cui salvare il valore se trovato
- ///
- protected bool getConfValInt(string chiave, ref int varObj)
- {
- bool answ = false;
-#if false
- if (CurrConfig != null && CurrConfig.Count > 0)
- {
- // sistemo i parametri opzionali...
- ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
- if (risultato != null)
- {
- answ = int.TryParse(risultato.Valore, out varObj);
- }
- }
-#endif
-
- return answ;
- }
-
- ///
- /// Recupera da conf eventuale setup tag dell'IOB indicato
- ///
- ///
- ///
- protected List? getIobTag(string codIob)
- {
- List? answ = null;
-#if false
- if (MMDataService.currTagConf != null)
- {
- // cerco x chiave IOB...
- if (MMDataService.currTagConf.ContainsKey(codIob))
- {
- answ = MMDataService.currTagConf[codIob];
- }
- }
-#endif
-
- return answ;
- }
-
- ///
- /// Recupera da redis (in una chiamata soltanto) tutti i valori richiesti e compone un dizionario x ottimizzare visualizzazione
- ///
- ///
- ///
- protected Dictionary getTagVal(string codIob)
- {
- Dictionary answ = new Dictionary();
-#if false
- // recupero conf tags...
- var currTags = getIobTag(codIob);
- if (currTags != null && currTags.Count > 0)
- {
- // FIXME TODO !!!! FARE !!!! - da verificare
- answ = currTags.ToDictionary(x => x.TagLocation, x => MMDataService.getTagConf(x.TagLocation));
- }
-#endif
-
- return answ;
- }
- }
-}
\ No newline at end of file
diff --git a/MP.WASM.Mon/Client/Pages/Index.razor.cs b/MP.WASM.Mon/Client/Pages/Index.razor.cs
index 42723414..f2218755 100644
--- a/MP.WASM.Mon/Client/Pages/Index.razor.cs
+++ b/MP.WASM.Mon/Client/Pages/Index.razor.cs
@@ -1,48 +1,25 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Components;
-using System.Net.Http;
-using System.Net.Http.Json;
-using Microsoft.AspNetCore.Components.Forms;
-using Microsoft.AspNetCore.Components.Routing;
-using Microsoft.AspNetCore.Components.Web;
-using Microsoft.AspNetCore.Components.Web.Virtualization;
-using Microsoft.AspNetCore.Components.WebAssembly.Http;
-using Microsoft.JSInterop;
-using MP.WASM.Mon.Client;
-using MP.WASM.Mon.Client.Shared;
-using MP.WASM.Mon.Client.Components;
-using MP.Data;
using MP.Data.Conf;
using MP.Data.DatabaseModels;
using NLog;
-
+using System.Net.Http.Json;
namespace MP.WASM.Mon.Client.Pages
{
- public partial class Index
+ public partial class Index : IDisposable
{
- private List? listMSE = null;
- private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
- private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
- private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
- protected int fastRefreshMs
- {
- get => 1000 * fastRefreshSec;
- }
- protected int slowRefreshMs
- {
- get => 1000 * slowRefreshSec;
- }
+ #region Public Methods
- protected bool doAnimate = true;
- protected int fastRefreshSec = 2;
- protected int keepAliveMin = 1;
- protected int maxCol = 6;
- protected string showArt = "";
- protected int slowRefreshSec = 300;
+ public void Dispose()
+ {
+#if false
+ //fastTimer.Elapsed -= ElapsedFastTimer;
+ fastTimer.Stop();
+ fastTimer.Dispose();
+ //slowTimer.Elapsed -= ElapsedSlowTimer;
+ slowTimer.Stop();
+ slowTimer.Dispose();
+#endif
+ }
public void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
{
@@ -62,7 +39,7 @@ namespace MP.WASM.Mon.Client.Pages
await Task.Delay(1);
Log.Trace("Elapsed Slow Timer");
#if false
- NavManager.NavigateTo(NavManager.Uri);
+ NavManager.NavigateTo(NavManager.Uri);
#endif
}
@@ -80,6 +57,128 @@ namespace MP.WASM.Mon.Client.Pages
slowTimer.Start();
}
+ #endregion Public Methods
+
+ #region Protected Fields
+
+ protected bool doAnimate = true;
+ protected int fastRefreshSec = 2;
+ protected int keepAliveMin = 1;
+ protected int maxCol = 6;
+ protected string showArt = "";
+ protected int slowRefreshSec = 300;
+
+ #endregion Protected Fields
+
+ #region Protected Properties
+
+ protected int fastRefreshMs
+ {
+ get => 1000 * fastRefreshSec;
+ }
+
+ protected int slowRefreshMs
+ {
+ get => 1000 * slowRefreshSec;
+ }
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ ///
+ /// Recupera il valore e se trovato aggiorna
+ ///
+ /// Valore da cercare
+ /// String in cui salvare il valore se trovato
+ ///
+ protected bool getConfVal(string chiave, ref string varObj)
+ {
+ bool answ = false;
+#if false
+ if (CurrConfig != null && CurrConfig.Count > 0)
+ {
+ // sistemo i parametri opzionali...
+ ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
+ if (risultato != null)
+ {
+ varObj = risultato.Valore;
+ answ = !string.IsNullOrEmpty(risultato.Valore);
+ }
+ }
+#endif
+
+ return answ;
+ }
+
+ ///
+ /// Recupera il valore e se trovato aggiorna
+ ///
+ /// Valore da cercare
+ /// Int in cui salvare il valore se trovato
+ ///
+ protected bool getConfValInt(string chiave, ref int varObj)
+ {
+ bool answ = false;
+#if false
+ if (CurrConfig != null && CurrConfig.Count > 0)
+ {
+ // sistemo i parametri opzionali...
+ ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
+ if (risultato != null)
+ {
+ answ = int.TryParse(risultato.Valore, out varObj);
+ }
+ }
+#endif
+
+ return answ;
+ }
+
+ ///
+ /// Recupera da conf eventuale setup tag dell'IOB indicato
+ ///
+ ///
+ ///
+ protected List? getIobTag(string codIob)
+ {
+ List? answ = null;
+#if false
+ if (MMDataService.currTagConf != null)
+ {
+ // cerco x chiave IOB...
+ if (MMDataService.currTagConf.ContainsKey(codIob))
+ {
+ answ = MMDataService.currTagConf[codIob];
+ }
+ }
+#endif
+
+ return answ;
+ }
+
+ ///
+ /// Recupera da redis (in una chiamata soltanto) tutti i valori richiesti e compone un
+ /// dizionario x ottimizzare visualizzazione
+ ///
+ ///
+ ///
+ protected Dictionary getTagVal(string codIob)
+ {
+ Dictionary answ = new Dictionary();
+#if false
+ // recupero conf tags...
+ var currTags = getIobTag(codIob);
+ if (currTags != null && currTags.Count > 0)
+ {
+ // FIXME TODO !!!! FARE !!!! - da verificare
+ answ = currTags.ToDictionary(x => x.TagLocation, x => MMDataService.getTagConf(x.TagLocation));
+ }
+#endif
+
+ return answ;
+ }
+
protected override async Task OnInitializedAsync()
{
await setupConf();
@@ -87,6 +186,19 @@ namespace MP.WASM.Mon.Client.Pages
StartTimer();
}
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
+ private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
+ private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
+ private List? listMSE = null;
+
+ #endregion Private Fields
+
+ #region Private Methods
+
private async Task ReloadData()
{
#if DEBUG
@@ -118,100 +230,10 @@ namespace MP.WASM.Mon.Client.Pages
getConfValInt("MSE_cacheDuration", ref fastRefreshSec);
getConfVal("sART", ref showArt);
Log.Info($"Effettuato setup parametri | keepAlive: {keepAliveMin} | MaxCol: {maxCol} | doAnimate: {doAnimate} | slowRefreshSec: {slowRefreshSec} | fastRefreshSec: {fastRefreshSec}");
- }
+ }
#endif
}
- ///
- /// Recupera il valore e se trovato aggiorna
- ///
- /// Valore da cercare
- /// String in cui salvare il valore se trovato
- ///
- protected bool getConfVal(string chiave, ref string varObj)
- {
- bool answ = false;
-#if false
- if (CurrConfig != null && CurrConfig.Count > 0)
- {
- // sistemo i parametri opzionali...
- ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
- if (risultato != null)
- {
- varObj = risultato.Valore;
- answ = !string.IsNullOrEmpty(risultato.Valore);
- }
- }
-#endif
-
- return answ;
- }
-
- ///
- /// Recupera il valore e se trovato aggiorna
- ///
- /// Valore da cercare
- /// Int in cui salvare il valore se trovato
- ///
- protected bool getConfValInt(string chiave, ref int varObj)
- {
- bool answ = false;
-#if false
- if (CurrConfig != null && CurrConfig.Count > 0)
- {
- // sistemo i parametri opzionali...
- ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
- if (risultato != null)
- {
- answ = int.TryParse(risultato.Valore, out varObj);
- }
- }
-#endif
-
- return answ;
- }
-
- ///
- /// Recupera da conf eventuale setup tag dell'IOB indicato
- ///
- ///
- ///
- protected List? getIobTag(string codIob)
- {
- List? answ = null;
-#if false
- if (MMDataService.currTagConf != null)
- {
- // cerco x chiave IOB...
- if (MMDataService.currTagConf.ContainsKey(codIob))
- {
- answ = MMDataService.currTagConf[codIob];
- }
- }
-#endif
-
- return answ;
- }
-
- ///
- /// Recupera da redis (in una chiamata soltanto) tutti i valori richiesti e compone un dizionario x ottimizzare visualizzazione
- ///
- ///
- ///
- protected Dictionary getTagVal(string codIob)
- {
- Dictionary answ = new Dictionary();
-#if false
- // recupero conf tags...
- var currTags = getIobTag(codIob);
- if (currTags != null && currTags.Count > 0)
- {
- // FIXME TODO !!!! FARE !!!! - da verificare
- answ = currTags.ToDictionary(x => x.TagLocation, x => MMDataService.getTagConf(x.TagLocation));
- }
-#endif
-
- return answ;
- }
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.WASM.Mon/Client/Shared/NavMenu.razor b/MP.WASM.Mon/Client/Shared/NavMenu.razor
deleted file mode 100644
index e1846d0c..00000000
--- a/MP.WASM.Mon/Client/Shared/NavMenu.razor
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-@code {
- private bool collapseNavMenu = true;
-
- private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
-
- private void ToggleNavMenu()
- {
- collapseNavMenu = !collapseNavMenu;
- }
-}
diff --git a/MP.WASM.Mon/Client/Shared/NavMenu.razor.css b/MP.WASM.Mon/Client/Shared/NavMenu.razor.css
deleted file mode 100644
index acc5f9f8..00000000
--- a/MP.WASM.Mon/Client/Shared/NavMenu.razor.css
+++ /dev/null
@@ -1,62 +0,0 @@
-.navbar-toggler {
- background-color: rgba(255, 255, 255, 0.1);
-}
-
-.top-row {
- height: 3.5rem;
- background-color: rgba(0,0,0,0.4);
-}
-
-.navbar-brand {
- font-size: 1.1rem;
-}
-
-.oi {
- width: 2rem;
- font-size: 1.1rem;
- vertical-align: text-top;
- top: -2px;
-}
-
-.nav-item {
- font-size: 0.9rem;
- padding-bottom: 0.5rem;
-}
-
- .nav-item:first-of-type {
- padding-top: 1rem;
- }
-
- .nav-item:last-of-type {
- padding-bottom: 1rem;
- }
-
- .nav-item ::deep a {
- color: #d7d7d7;
- border-radius: 4px;
- height: 3rem;
- display: flex;
- align-items: center;
- line-height: 3rem;
- }
-
-.nav-item ::deep a.active {
- background-color: rgba(255,255,255,0.25);
- color: white;
-}
-
-.nav-item ::deep a:hover {
- background-color: rgba(255,255,255,0.1);
- color: white;
-}
-
-@media (min-width: 641px) {
- .navbar-toggler {
- display: none;
- }
-
- .collapse {
- /* Never collapse the sidebar for wide screens */
- display: block;
- }
-}
diff --git a/MP.WASM.Mon/Client/wwwroot/css/app.css b/MP.WASM.Mon/Client/wwwroot/css/app.css
index 9cd148f7..62619b01 100644
--- a/MP.WASM.Mon/Client/wwwroot/css/app.css
+++ b/MP.WASM.Mon/Client/wwwroot/css/app.css
@@ -1,7 +1,6 @@
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
html, body {
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
h1:focus {
diff --git a/MP.WASM.Mon/Client/wwwroot/index.html b/MP.WASM.Mon/Client/wwwroot/index.html
index 752a9e55..6d26eeef 100644
--- a/MP.WASM.Mon/Client/wwwroot/index.html
+++ b/MP.WASM.Mon/Client/wwwroot/index.html
@@ -7,7 +7,8 @@
MP.WASM.Mon
-
+
+
@@ -24,6 +25,8 @@
🗙
+