diff --git a/MP.Data/Services/IOC/IocService.cs b/MP.Data/Services/IOC/IocService.cs index d4041c5f..93856041 100644 --- a/MP.Data/Services/IOC/IocService.cs +++ b/MP.Data/Services/IOC/IocService.cs @@ -465,22 +465,10 @@ namespace MP.Data.Services.IOC return cachedValue!; } - await _semaphore.WaitAsync(); - try - { - if (_cache.TryGetValue(cacheKey, out cachedValue)) - { - return cachedValue!; - } - - T newValue = await fetchFunc(); - _cache.Set(cacheKey, newValue, expiration); - return newValue; - } - finally - { - _semaphore.Release(); - } + // se non trovato procedo as usual... + T newValue = await fetchFunc(); + _cache.Set(cacheKey, newValue, expiration); + return newValue; } /// @@ -834,9 +822,7 @@ namespace MP.Data.Services.IOC //double numSecCache = ((result["insEnabled"].ToLower() == "true") ? redisShortTimeCache : redisLongTimeCache); numSecCache = dbResult.InsEnabled ? redisShortTimeCache : redisLongTimeCache; } - else - { - } + // dati master/slave string isMaster = (await ListMasterAsync()).Contains(idxMacc) ? "1" : "0"; string isSlave = (await ListSlaveAsync()).Contains(idxMacc) ? "1" : "0"; diff --git a/MP.IOC/Components/Pages/RouteConf.razor b/MP.IOC/Components/Pages/RouteConf.razor index 2d68634b..25c4ae6b 100644 --- a/MP.IOC/Components/Pages/RouteConf.razor +++ b/MP.IOC/Components/Pages/RouteConf.razor @@ -22,9 +22,9 @@ Metodo - IO % - Balance - IOC % + IO % + Balance Balance + IOC % @@ -55,9 +55,9 @@ @record.OldWeight - - - + + + @record.NewWeight diff --git a/MP.IOC/Components/Pages/RouteConf.razor.cs b/MP.IOC/Components/Pages/RouteConf.razor.cs index c18c066b..35822888 100644 --- a/MP.IOC/Components/Pages/RouteConf.razor.cs +++ b/MP.IOC/Components/Pages/RouteConf.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; using MP.Core.DTO; using MP.IOC.Services; @@ -13,6 +14,9 @@ namespace MP.IOC.Components.Pages get => string.IsNullOrEmpty(SearchVal) ? "btn-outline-secondary" : "btn-primary"; } + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + protected string SearchVal { get => _searchVal; @@ -88,25 +92,6 @@ namespace MP.IOC.Components.Pages SelRecord = curRec; } - /// - /// Imposta il peso del metodo "New" come richiesto, con eventuale check sui limiti 0-100 - /// - /// - /// - private async Task SetNewWeight(WeightDTO curRec, int newWeight) - { - newWeight = Math.Clamp(newWeight, 0, 100); - curRec.NewWeight = newWeight; - curRec.OldWeight = 100 - newWeight; - // salvo! - WService.UpsertWeight(curRec); - // rileggo! - await ReloadData(); - UpdateTable(); - } - - - private void DoReset() { SelRecord = null; @@ -136,6 +121,45 @@ namespace MP.IOC.Components.Pages UpdateTable(); } + /// + /// Imposta globalmente weight x tutte le chiavi... + /// + /// + /// + private async Task SetAllWeight(int newWeight) + { + if (!await JSRuntime.InvokeAsync("confirm", "Confermi di voler impostare questo peso per TUTTE le chiamate?")) + return; + + newWeight = Math.Clamp(newWeight, 0, 100); + foreach (var curRec in ListComplete) + { + curRec.NewWeight = newWeight; + curRec.OldWeight = 100 - newWeight; + WService.UpsertWeight(curRec); + } + // rileggo! + await ReloadData(); + UpdateTable(); + } + + /// + /// Imposta il peso del metodo "New" come richiesto, con eventuale check sui limiti 0-100 + /// + /// + /// + private async Task SetNewWeight(WeightDTO curRec, int newWeight) + { + newWeight = Math.Clamp(newWeight, 0, 100); + curRec.NewWeight = newWeight; + curRec.OldWeight = 100 - newWeight; + // salvo! + WService.UpsertWeight(curRec); + // rileggo! + await ReloadData(); + UpdateTable(); + } + private void UpdateTable() { // effettuo eventuale ricerca + conteggio... diff --git a/MP.IOC/MP.IOC.csproj b/MP.IOC/MP.IOC.csproj index 0a714ad2..69a7a795 100644 --- a/MP.IOC/MP.IOC.csproj +++ b/MP.IOC/MP.IOC.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 8.16.2605.811 + 8.16.2605.1112 diff --git a/MP.IOC/Resources/ChangeLog.html b/MP.IOC/Resources/ChangeLog.html index 4ba1f793..ae820af1 100644 --- a/MP.IOC/Resources/ChangeLog.html +++ b/MP.IOC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MP-IOC -

Versione: 8.16.2605.811

+

Versione: 8.16.2605.1112


Note di rilascio:
  • diff --git a/MP.IOC/Resources/VersNum.txt b/MP.IOC/Resources/VersNum.txt index ddc2c22a..482cea3b 100644 --- a/MP.IOC/Resources/VersNum.txt +++ b/MP.IOC/Resources/VersNum.txt @@ -1 +1 @@ -8.16.2605.811 +8.16.2605.1112 diff --git a/MP.IOC/Resources/manifest.xml b/MP.IOC/Resources/manifest.xml index bb27fee8..914fdc0f 100644 --- a/MP.IOC/Resources/manifest.xml +++ b/MP.IOC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 8.16.2605.811 + 8.16.2605.1112 https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html false