Update tools view x sel parametri home
This commit is contained in:
@@ -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<DisplayDataDTO>? 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<string> SelVal { get; set; } = new List<string>();
|
||||
|
||||
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<string>();
|
||||
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<DisplayDataDTO>? 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
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.2.2210.308</Version>
|
||||
<Version>1.2.2210.309</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.2.2210.308</h4>
|
||||
<h4>Version: 1.2.2210.309</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.2210.308
|
||||
1.2.2210.309
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.2.2210.308</version>
|
||||
<version>1.2.2210.309</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user