Modifica x
- editabilità bilanciamento route config - riduzione log controller IOB - review iniziale metodi
This commit is contained in:
@@ -49,16 +49,8 @@
|
||||
}
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-2">
|
||||
<NavLink class="nav-link py-0 px-2 mb-0" href="UpdateManager">
|
||||
<span class="fas fa-download fs-4 pe-2" aria-hidden="true"></span>
|
||||
@if (showText)
|
||||
{
|
||||
<span class="@hideText">Update Manager</span>
|
||||
}
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-2">
|
||||
|
||||
@* <div class="nav-item px-2">
|
||||
<NavLink class="nav-link py-0 px-2 mb-0" href="about">
|
||||
<span class="fas fa-info-circle fs-4 pe-2" aria-hidden="true"></span>
|
||||
@if (showText)
|
||||
@@ -75,8 +67,8 @@
|
||||
<span class="@hideText">Contacts</span>
|
||||
}
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-2">
|
||||
</div> *@
|
||||
@* <div class="nav-item px-2">
|
||||
<NavLink class="nav-link py-0 px-2 mb-0" href="RefreshData">
|
||||
<span class="fas fa-sync-alt fs-4 pe-2" aria-hidden="true"></span>
|
||||
@if (showText)
|
||||
@@ -84,7 +76,7 @@
|
||||
<span class="@hideText">Refresh Data</span>
|
||||
}
|
||||
</NavLink>
|
||||
</div>
|
||||
</div> *@
|
||||
}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -1,27 +1,85 @@
|
||||
@page "/RouteConf"
|
||||
<div class="card shadow">
|
||||
<div class="card-header">
|
||||
<h3>Route Configuration (IO/IOC)</h3>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
<h3>Route Configuration (IO/IOC)</h3>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa-solid fa-magnifying-glass"></i></span>
|
||||
<input type="text" class="form-control" placeholder="Ricerca: alt-/" accesskey="/" @bind="SearchVal" />
|
||||
<button class="btn btn-sm @CssReset" @onclick="ResetSearch"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button>
|
||||
</th>
|
||||
<th>Metodo</th>
|
||||
<th>IO %</th>
|
||||
<th>IOC %</th>
|
||||
<th class="text-start">IO %</th>
|
||||
<th class="text-center">Balance</th>
|
||||
<th class="text-end">IOC %</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListPaged)
|
||||
{
|
||||
<tr class="@CheckSelect(record)">
|
||||
<td>
|
||||
@if (SelRecord == null)
|
||||
{
|
||||
<button class="btn btn-sm btn-info" @onclick="() => DoEdit(record)"><i class="fa-solid fa-pencil"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SelRecord.Method == record.Method)
|
||||
{
|
||||
<button class="btn btn-sm btn-success" @onclick="() => DoSave(record)"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-sm btn-secondary disabled"><i class="fa-solid fa-pencil"></i></button>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
<td>@record.Method</td>
|
||||
<td>@record.OldWeight</td>
|
||||
<td>@record.NewWeight</td>
|
||||
<td class="text-start">
|
||||
<button class="btn btn-sm btn-warning" @onclick="() => SetNewWeight(record, 0)" title="Set 100% IO"><i class="fa-solid fa-scale-unbalanced"></i></button>
|
||||
@record.OldWeight
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button class="btn btn-sm btn-warning" @onclick="() => SetNewWeight(record, record.NewWeight - 10)" title="Seto 50%">+10%</button>
|
||||
<button class="btn btn-sm btn-success" @onclick="() => SetNewWeight(record, 50)" title="Seto 50%"><i class="fa-solid fa-scale-balanced"></i></button>
|
||||
<button class="btn btn-sm btn-info" @onclick="() => SetNewWeight(record, record.NewWeight + 10)" title="Seto 50%">+10%</button>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
@record.NewWeight
|
||||
<button class="btn btn-sm btn-info" @onclick="() => SetNewWeight(record, 100)" title="Set 100% IOC"><i class="fa-solid fa-scale-unbalanced-flip"></i></button>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
@if (SelRecord != null && SelRecord.Method == record.Method)
|
||||
{
|
||||
<button class="btn btn-sm btn-warning" @onclick="DoReset"><i class="fa-solid fa-ban"></i></button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="10">
|
||||
<EgwCoreLib.Razor.DataPager currPage="@pageNum" PageSize="@numRecPage" totalCount="@totalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec" DisplSize="DataPager.ObjSize.small"></EgwCoreLib.Razor.DataPager>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -6,6 +6,28 @@ namespace MP.IOC.Components.Pages
|
||||
{
|
||||
public partial class RouteConf
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected string CssReset
|
||||
{
|
||||
get => string.IsNullOrEmpty(SearchVal) ? "btn-outline-secondary" : "btn-primary";
|
||||
}
|
||||
|
||||
protected string SearchVal
|
||||
{
|
||||
get => _searchVal;
|
||||
set
|
||||
{
|
||||
if (_searchVal != value)
|
||||
{
|
||||
_searchVal = value;
|
||||
UpdateTable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected string CheckSelect(WeightDTO currRec)
|
||||
@@ -20,19 +42,30 @@ namespace MP.IOC.Components.Pages
|
||||
UpdateTable();
|
||||
}
|
||||
|
||||
protected void ResetSearch()
|
||||
{
|
||||
SearchVal = "";
|
||||
//UpdateTable();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string _searchVal = "";
|
||||
|
||||
private List<WeightDTO> ListComplete = new();
|
||||
|
||||
private List<WeightDTO> ListPaged = new();
|
||||
|
||||
private List<WeightDTO> ListSearch = new();
|
||||
|
||||
private int numRecPage = 10;
|
||||
|
||||
private int pageNum = 1;
|
||||
|
||||
private WeightDTO? SelRecord = null;
|
||||
|
||||
private int totalCount = 0;
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -46,10 +79,30 @@ namespace MP.IOC.Components.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Edit record selezionato
|
||||
/// </summary>
|
||||
/// <param name="curRec"></param>
|
||||
private void DoEdit(WeightDTO curRec)
|
||||
{
|
||||
SelRecord = curRec;
|
||||
}
|
||||
|
||||
private void DoReset()
|
||||
{
|
||||
SelRecord = null;
|
||||
}
|
||||
|
||||
private void DoSave(WeightDTO updRec)
|
||||
{
|
||||
// salvo e resetto...
|
||||
|
||||
SelRecord = null;
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
ListComplete = await WService.GetAllWeightsAsync();
|
||||
totalCount = ListComplete.Count();
|
||||
}
|
||||
|
||||
private void SaveNumRec(int newNum)
|
||||
@@ -66,14 +119,26 @@ namespace MP.IOC.Components.Pages
|
||||
|
||||
private void UpdateTable()
|
||||
{
|
||||
// esegue paginazione
|
||||
if (totalCount > numRecPage)
|
||||
// effettuo eventuale ricerca + conteggio...
|
||||
if (string.IsNullOrEmpty(SearchVal))
|
||||
{
|
||||
ListPaged = ListComplete.Skip((pageNum - 1) * numRecPage).Take(numRecPage).ToList();
|
||||
ListSearch = ListComplete;
|
||||
}
|
||||
else
|
||||
{
|
||||
ListPaged = ListComplete;
|
||||
ListSearch = ListComplete
|
||||
.Where(x => x.Method.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase))
|
||||
.ToList();
|
||||
}
|
||||
totalCount = ListSearch.Count();
|
||||
// esegue paginazione
|
||||
if (totalCount > numRecPage)
|
||||
{
|
||||
ListPaged = ListSearch.Skip((pageNum - 1) * numRecPage).Take(numRecPage).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
ListPaged = ListSearch;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,8 @@ namespace MP.IOC.Controllers
|
||||
|
||||
public IOBController(IConfiguration configuration, MpDataService DataService)
|
||||
{
|
||||
Log.Info("Starting IOBController");
|
||||
_configuration = configuration;
|
||||
DService = DataService;
|
||||
Log.Info("Avviato IOBController");
|
||||
}
|
||||
|
||||
|
||||
@@ -82,29 +80,19 @@ namespace MP.IOC.Controllers
|
||||
[HttpGet("enabled/{id}")]
|
||||
public string enabled(string id)
|
||||
{
|
||||
string answ = "ND";
|
||||
// se id nullo --> KO!
|
||||
if (id == null)
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = DService.IobInsEnab(id) ? "OK" : "NO";
|
||||
if (string.IsNullOrEmpty(id)) return "KO";
|
||||
|
||||
//// 2025.03.04 aggiunto keepalive x evitare C101
|
||||
//MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
//connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in enabled{Environment.NewLine}{exc}");
|
||||
answ = "NO";
|
||||
}
|
||||
try
|
||||
{
|
||||
var result = DService.IobInsEnab(id) ? "OK" : "NO";
|
||||
// Logga solo l'esito se necessario
|
||||
return result;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in enabled {id}: {exc.Message}");
|
||||
return "NO";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
///// <summary> AGGIUNGE TASK richiesto x macchina:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.16.2604.1010</Version>
|
||||
<Version>6.16.2604.1011</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MP-IOC </i>
|
||||
<h4>Versione: 6.16.2604.1010</h4>
|
||||
<h4>Versione: 6.16.2604.1011</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2604.1010
|
||||
6.16.2604.1011
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2604.1010</version>
|
||||
<version>6.16.2604.1011</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user