diff --git a/MP-TAB-SERV/MP-TAB-SERV.csproj b/MP-TAB-SERV/MP-TAB-SERV.csproj
index 3c00190a..ffe19f03 100644
--- a/MP-TAB-SERV/MP-TAB-SERV.csproj
+++ b/MP-TAB-SERV/MP-TAB-SERV.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 6.16.2312.1215
+ 6.16.2312.1216
enable
MP_TAB_SERV
diff --git a/MP-TAB-SERV/Pages/_Layout.cshtml b/MP-TAB-SERV/Pages/_Layout.cshtml
index 0a7d54c9..0059df26 100644
--- a/MP-TAB-SERV/Pages/_Layout.cshtml
+++ b/MP-TAB-SERV/Pages/_Layout.cshtml
@@ -38,14 +38,7 @@
🗙
- @*
- *@
- @**@
- @*
- *@
- @**@
-
diff --git a/MP-TAB-SERV/Resources/ChangeLog.html b/MP-TAB-SERV/Resources/ChangeLog.html
index 61e95d92..880e6407 100644
--- a/MP-TAB-SERV/Resources/ChangeLog.html
+++ b/MP-TAB-SERV/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
- Versione: 6.16.2312.1215
+ Versione: 6.16.2312.1216
Note di rilascio:
-
diff --git a/MP-TAB-SERV/Resources/VersNum.txt b/MP-TAB-SERV/Resources/VersNum.txt
index 14723875..7de4424c 100644
--- a/MP-TAB-SERV/Resources/VersNum.txt
+++ b/MP-TAB-SERV/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2312.1215
+6.16.2312.1216
diff --git a/MP-TAB-SERV/Resources/manifest.xml b/MP-TAB-SERV/Resources/manifest.xml
index 9189f131..e503a1d4 100644
--- a/MP-TAB-SERV/Resources/manifest.xml
+++ b/MP-TAB-SERV/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2312.1215
+ 6.16.2312.1216
https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip
https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html
false
diff --git a/MP-TAB-SERV/Shared/MainLayout.razor.cs b/MP-TAB-SERV/Shared/MainLayout.razor.cs
index 73566389..c8fc0d4a 100644
--- a/MP-TAB-SERV/Shared/MainLayout.razor.cs
+++ b/MP-TAB-SERV/Shared/MainLayout.razor.cs
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Components.Routing;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.Services;
+using MP_TAB_SERV.Components;
using NLog;
namespace MP_TAB_SERV.Shared
@@ -65,14 +66,24 @@ namespace MP_TAB_SERV.Shared
protected string bodyTipe
{
- get => NavMan.Uri.Contains("reg-new-device") ? "mainBodyNoSide" : "mainBody";
+ get => pageOk ? "mainBodyNoSide" : "mainBody";
+ }
+
+ protected bool pageOk
+ {
+ get
+ {
+ string currPage = NavMan.Uri;
+ return currPage.Contains("logout") || currPage.Contains("reg-new-device");
+ }
}
protected async Task handleBodyClick()
{
await Task.Delay(1);
- if (!NavMan.Uri.Contains("reg-new-device"))
+ MsgServ.dtLastAction = DateTime.Now;
+ if (!pageOk)
{
await checkDtDiff2Logout();
}
@@ -87,29 +98,43 @@ namespace MP_TAB_SERV.Shared
protected async Task checkDtDiff2Logout()
{
- var diffOfTime = DateTime.Now - MsgServ.dtLastAction;
+ TimeSpan tsDeltaAct = DateTime.Now.Subtract(MsgServ.dtLastAction);
+ TimeSpan tsDeltaSave = DateTime.Now.Subtract(MsgServ.dtLastSave);
switch (typeScadLogin)
{
case 0:
- if (diffOfTime.Minutes >= dtScadLogin)
+ if (tsDeltaAct.Minutes >= dtScadLogin)
{
NavMan.NavigateTo("logout");
}
break;
case 1:
- if (diffOfTime.Minutes >= dtScadLogin)
+ if (tsDeltaAct.Minutes >= dtScadLogin)
{
var userTkn = await TDataService.OperatoreGetRedis(MatrOpr);
if (!string.IsNullOrEmpty(userTkn))
{
await MsgServ.DoLogIn(userTkn);
- MsgServ.dtLastAction = DateTime.Now;
+ MsgServ.dtLastSave = DateTime.Now;
}
else
{
NavMan.NavigateTo("logout");
}
}
+ else
+ {
+ // se fosse oltre mezzo periodo da ultimo save --> salvo!
+ if (tsDeltaSave.TotalMinutes > dtScadLogin * 0.8)
+ {
+ var userTkn = await TDataService.OperatoreGetRedis(MatrOpr);
+ if (!string.IsNullOrEmpty(userTkn))
+ {
+ await MsgServ.DoLogIn(userTkn);
+ MsgServ.dtLastSave = DateTime.Now;
+ }
+ }
+ }
break;
}
}
diff --git a/MP.Data/Services/MessageService.cs b/MP.Data/Services/MessageService.cs
index 50cece25..2855c6ec 100644
--- a/MP.Data/Services/MessageService.cs
+++ b/MP.Data/Services/MessageService.cs
@@ -119,6 +119,7 @@ namespace MP.Data.Services
}
public DateTime dtLastAction { get; set; } = DateTime.Now;
+ public DateTime dtLastSave { get; set; } = DateTime.Now;
public int MatrOpr
{