-
+
@if (isAddNew)
{
diff --git a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs
index f386a1b..98b9711 100644
--- a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs
+++ b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs
@@ -55,6 +55,8 @@ namespace WebDoorCreator.UI.Components.DoorMan
protected List
doorOps2Add = new List();
+ protected string[] hexVals = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
+
#endregion Protected Fields
#region Protected Properties
@@ -253,20 +255,58 @@ namespace WebDoorCreator.UI.Components.DoorMan
return answ;
}
+ protected string hexConverter(string hexColor, int delta)
+ {
+ string answ = "";
+ if (hexColor != "" && hexColor != null)
+ {
+ var noHash = hexColor.Substring(1, hexColor.Length - 1);
+ StringBuilder sb = new StringBuilder();
+
+ foreach (var val in noHash)
+ {
+ sb.Append(newHexVal(val, delta));
+ }
+
+ answ = $"#{sb.ToString()}";
+ }
+
+ return answ;
+ }
+
protected async Task modalClose(bool isClose)
{
await Task.Delay(1);
isTpl = isClose;
await ReloadData();
}
- private int lastOrderId = -1;
- private DoorsSelectFilter lastFilt = new DoorsSelectFilter() { CurrPage = -1 };
+
+ protected string newHexVal(char str2Check, int delta)
+ {
+ string answ = "";
+ int runIdx = 0;
+ foreach (var item in hexVals)
+ {
+ if (item.ToLower() == str2Check.ToString().ToLower())
+ {
+ int currValIndex = Array.IndexOf(hexVals, item);
+ runIdx = currValIndex + delta;
+ runIdx = runIdx <= 15 ? runIdx : 15;
+ answ = hexVals[runIdx];
+ }
+ }
+ return answ;
+ }
+
+ protected override void OnInitialized()
+ {
+ WaitReloadSvg = Configuration.GetValue("RuntimeOpt:WaitReloadSvg");
+ }
protected override async Task OnParametersSetAsync()
{
- if (currOrderId != lastOrderId || !actFilter.Equals(lastFilt))
+ if (!actFilter.Equals(lastFilt))
{
- lastOrderId = currOrderId;
lastFilt = actFilter.clone();
await ReloadData();
}
@@ -275,7 +315,7 @@ namespace WebDoorCreator.UI.Components.DoorMan
///
/// Esecuzione ricalcolo SVG
///
- protected async void RecalcSVGs()
+ protected async void RecalcSVGs(bool force)
{
isRecalc = true;
// recupero elenco porte come list interi...
@@ -295,22 +335,30 @@ namespace WebDoorCreator.UI.Components.DoorMan
// chiamo reset richieste
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
- // se ho porte da processare --> chiamo save...
- string currDDF = "";
- int currDoorId = 0;
- int currVers = 0;
- foreach (var item in list2Proc)
+ if (force)
{
- currDoorId = 0;
- currVers = 0;
- int.TryParse(item, out currDoorId);
- if (currDoorId > 0)
+ // se ho porte da processare --> chiamo save...
+ string currDDF = "";
+ int currDoorId = 0;
+ int currVers = 0;
+ foreach (var item in list2Proc)
{
- currDDF = await WDService.DoorOpGetDDF(currDoorId);
- // versione corrente del DDF generato
- currVers = await QDService.SendCalcReq(currDoorId, currDDF);
+ currDoorId = 0;
+ currVers = 0;
+ int.TryParse(item, out currDoorId);
+ if (currDoorId > 0)
+ {
+ currDDF = await WDService.DoorOpGetDDF(currDoorId);
+ // versione corrente del DDF generato
+ currVers = await QDService.SendCalcReq(currDoorId, currDDF);
+ }
}
}
+ else
+ {
+ // attesa prima di ricaricare 200/500 ms...
+ await Task.Delay(DoorsList.Count * (WaitReloadSvg / 3) * rnd.Next(900, 1200) / 1000);
+ }
}
isRecalc = false;
NavManager.NavigateTo(NavManager.Uri, true);
@@ -440,6 +488,14 @@ namespace WebDoorCreator.UI.Components.DoorMan
#endregion Protected Methods
+ #region Private Fields
+
+ private DoorsSelectFilter lastFilt = new DoorsSelectFilter() { CurrPage = -1 };
+ private Random rnd = new Random();
+ private int WaitReloadSvg = 100;
+
+ #endregion Private Fields
+
#region Private Properties
private int _totalCount { get; set; } = 0;
@@ -476,44 +532,5 @@ namespace WebDoorCreator.UI.Components.DoorMan
}
#endregion Private Properties
-
- protected string[] hexVals = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
-
- protected string newHexVal(char str2Check, int delta)
- {
- string answ = "";
- int runIdx = 0;
- foreach (var item in hexVals)
- {
- if (item.ToLower() == str2Check.ToString().ToLower())
- {
- int currValIndex = Array.IndexOf(hexVals, item);
- runIdx = currValIndex + delta;
- runIdx = runIdx <= 15 ? runIdx : 15;
- answ = hexVals[runIdx];
- }
- }
- return answ;
- }
-
- protected string hexConverter(string hexColor, int delta)
- {
- string answ = "";
- if (hexColor != "" && hexColor != null)
- {
-
- var noHash = hexColor.Substring(1, hexColor.Length - 1);
- StringBuilder sb = new StringBuilder();
-
- foreach (var val in noHash)
- {
- sb.Append(newHexVal(val, delta));
- }
-
- answ = $"#{sb.ToString()}";
- }
-
- return answ;
- }
}
}
\ No newline at end of file
diff --git a/WebDoorCreator.UI/Components/Order/OrderList.razor b/WebDoorCreator.UI/Components/Order/OrderList.razor
index 94675f0..dcd4e89 100644
--- a/WebDoorCreator.UI/Components/Order/OrderList.razor
+++ b/WebDoorCreator.UI/Components/Order/OrderList.razor
@@ -43,7 +43,7 @@ else
}
else
{
-
+
@if (item.OrderStatus < 30 || WDCUService.userRole == "DcaAdmin" || WDCUService.userRole == "SuperAdmin")
diff --git a/WebDoorCreator.UI/Components/Order/OrderList.razor.cs b/WebDoorCreator.UI/Components/Order/OrderList.razor.cs
index 9161ce3..5c09499 100644
--- a/WebDoorCreator.UI/Components/Order/OrderList.razor.cs
+++ b/WebDoorCreator.UI/Components/Order/OrderList.razor.cs
@@ -224,7 +224,7 @@ namespace WebDoorCreator.UI.Components.Order
if (localOrdId != 0)
{
- await setOrd2Show(localOrdId);
+ await setOrd2Show(localOrdId, false);
}
}
}
@@ -267,16 +267,29 @@ namespace WebDoorCreator.UI.Components.Order
return $"api/Report/GetOrderReport?OrderId={orderId}&Format=PDF";
}
- protected async Task setOrd2Show(int orderId)
+ private bool isLoading = false;
+
+ protected async Task setOrd2Show(int orderId, bool doSave)
{
await Task.Delay(1);
+ if (ListOrdersStatus == null && !isLoading)
+ {
+ await ReloadData();
+ }
+ else
+ {
+ await Task.Delay(200);
+ }
if (ListOrdersStatus != null)
{
var chosenOrd = ListOrdersStatus.Where(x => x.OrderId == orderId).FirstOrDefault();
if (chosenOrd != null)
{
Ord2Show = chosenOrd;
- await localStorage.SetItemAsync("OrderId", orderId);
+ if (doSave)
+ {
+ await localStorage.SetItemAsync("OrderId", orderId);
+ }
await E_SetOrd2Show.InvokeAsync(chosenOrd);
}
}
@@ -406,6 +419,7 @@ namespace WebDoorCreator.UI.Components.Order
private async Task ReloadData()
{
+ isLoading = true;
ListOrdersStatus = null;
var domani = DateTime.Today.AddDays(1);
@@ -533,8 +547,7 @@ namespace WebDoorCreator.UI.Components.Order
}
}
}
-
- await Task.Delay(1);
+ isLoading = false;
await InvokeAsync(StateHasChanged);
}
diff --git a/WebDoorCreator.UI/Controllers/DoorImageController.cs b/WebDoorCreator.UI/Controllers/DoorImageController.cs
index 52d6b6c..2a9753b 100644
--- a/WebDoorCreator.UI/Controllers/DoorImageController.cs
+++ b/WebDoorCreator.UI/Controllers/DoorImageController.cs
@@ -15,16 +15,18 @@ namespace WebDoorCreator.UI.Controllers
public DoorImageController(IConfiguration configuration, QueueDataService cQDService, WebDoorCreatorService cWDCService)
{
- Log.Info("Starting DoorImageController");
+ Log.Trace("Starting DoorImageController");
_configuration = configuration;
WaitReloadSvg = _configuration.GetValue("RuntimeOpt:WaitReloadSvg");
QDService = cQDService;
WDService = cWDCService;
- Log.Info("Avviato DoorImageController");
+ Log.Trace("Avviato DoorImageController");
}
#endregion Public Constructors
+ private Random rnd = new Random();
+
#region Public Methods
// GET: api/DoorImage
@@ -44,7 +46,7 @@ namespace WebDoorCreator.UI.Controllers
string vetoReq = await QDService.DoorProcVetoGetAsync(DoorId);
if (string.IsNullOrEmpty(vetoReq))
{
- await QDService.DoorProcVetoSetAsync(DoorId, 2000);
+ await QDService.DoorProcVetoSetAsync(DoorId, WaitReloadSvg * 20);
// richiede ricalcolo img
await SendRecalcReq(DoorId);
@@ -53,6 +55,13 @@ namespace WebDoorCreator.UI.Controllers
// riprova lettura
svgContent = await QDService.DoorGetLastSvg(DoorId);
}
+ else
+ {
+ // attesa causale per vedere SE riesce a leggere ugualmente...faccio rand (4..10)*wait reload...
+ await Task.Delay(WaitReloadSvg * rnd.Next(4, 10));
+ // riprovo lettura
+ svgContent = await QDService.DoorGetLastSvg(DoorId);
+ }
}
// se fosse vuoto...
if (string.IsNullOrEmpty(svgContent))
diff --git a/WebDoorCreator.UI/WebDoorCreator.UI.csproj b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
index 2333801..e883ad9 100644
--- a/WebDoorCreator.UI/WebDoorCreator.UI.csproj
+++ b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 0.9.2403.1110
+ 0.9.2403.1112
enable
aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608