From d8071e3658737dfeb5a80e5aa8524d33df800e07 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 3 Oct 2022 09:41:32 +0200 Subject: [PATCH] Update tools view x sel parametri home --- MP.MONO.UI/Components/ToolsOverview.razor.cs | 83 +++++++++++++------- MP.MONO.UI/MP.MONO.UI.csproj | 2 +- MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- 5 files changed, 57 insertions(+), 34 deletions(-) diff --git a/MP.MONO.UI/Components/ToolsOverview.razor.cs b/MP.MONO.UI/Components/ToolsOverview.razor.cs index 83e39ab..50fa72b 100644 --- a/MP.MONO.UI/Components/ToolsOverview.razor.cs +++ b/MP.MONO.UI/Components/ToolsOverview.razor.cs @@ -1,35 +1,69 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using MP.MONO.UI; -using MP.MONO.UI.Shared; -using MP.MONO.UI.Components; using MP.MONO.Core.DTO; -using MP.MONO.UI.Data; -using Newtonsoft.Json; using MP.MONO.Data; +using Newtonsoft.Json; namespace MP.MONO.UI.Components { public partial class ToolsOverview { - private List? ListRecords { get; set; } = null; + #region Public Properties + + [Parameter] + public bool ShowReduced { get; set; } = false; + + #endregion Public Properties + + #region Protected Methods + protected override async Task OnInitializedAsync() { await ReloadData(); MMDataService.toolsPipe.EA_NewMessage += ToolsPipe_EA_NewMessage; } + [Parameter] + public List SelVal { get; set; } = new List(); + + protected string percProgress(double num, double minVal, double maxVal) + { + string answ = "width: 0%;"; + double den = (maxVal - minVal) != 0 ? (maxVal - minVal) : 1; + double ratio = ((double)num) / den; + answ = $"width: {ratio:P0};"; + return answ; + } + + protected async Task ReloadData() + { + SelVal = new List(); + var allData = await MMDataService.getTools(); + // se modalità reduced --> mostro solo il subset dati filtrati... + if (ShowReduced) + { + ListRecords = allData + .Where(x => x.HLShow) + .OrderBy(x => x.Order) + .ToList(); + } + else + { + ListRecords = allData + .OrderBy(x => x.Order) + .ToList(); + } + } + + #endregion Protected Methods + + #region Private Properties + + private List? ListRecords { get; set; } = null; + + #endregion Private Properties + + #region Private Methods + private void ToolsPipe_EA_NewMessage(object? sender, EventArgs e) { PubSubEventArgs currArgs = (PubSubEventArgs)e; @@ -48,17 +82,6 @@ namespace MP.MONO.UI.Components }); } - protected string percProgress(double num, double minVal, double maxVal) - { - string answ = "width: 0%;"; - double den = (maxVal - minVal) != 0 ? (maxVal - minVal) : 1; - double ratio = ((double)num) / den; - answ = $"width: {ratio:P0};"; - return answ; - } - protected async Task ReloadData() - { - ListRecords = await MMDataService.getTools(); - } + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index 2f5b141..86a0358 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2210.308 + 1.2.2210.309 diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index f7c73bc..91a55e4 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

Version: 1.2.2210.308

+

Version: 1.2.2210.309


Release Note:
  • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index f2b2b7c..adf437f 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2210.308 +1.2.2210.309 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index eb0b69f..b90d397 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2210.308 + 1.2.2210.309 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false