Evento reload gestito + rilettura pagina gestita
This commit is contained in:
@@ -138,8 +138,8 @@ namespace MP_TAB3.Components
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
Log.Info("MseSampler Timer Disposed!");
|
||||
GC.Collect();
|
||||
Log.Info("MseSampler Timer Disposed!");
|
||||
}
|
||||
|
||||
private async Task RefreshData()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2402.619</Version>
|
||||
<Version>6.16.2402.1909</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -40,5 +40,31 @@
|
||||
<script src="lib/WindowSize.js"></script>
|
||||
<script src="lib/bootstrap/js/bootstrap.bundle.js"></script>
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
|
||||
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
|
||||
<script>
|
||||
Blazor.start({
|
||||
reconnectionOptions: {
|
||||
maxRetries: 300,
|
||||
retryIntervalMilliseconds: 2000
|
||||
}
|
||||
}).then(() => {
|
||||
Object.defineProperty(Blazor.defaultReconnectionHandler, '_reconnectionDisplay', {
|
||||
get() {
|
||||
return this.__reconnectionDisplay;
|
||||
},
|
||||
set(value) {
|
||||
this.__reconnectionDisplay = {
|
||||
show: () => value.show(),
|
||||
update: (d) => value.update(d),
|
||||
rejected: (d) => document.location.reload()
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@*Gestione ricollegamento successivo: https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0*@
|
||||
<script>Blazor.defaultReconnectionHandler._reconnectCallback = function (d) { document.location.reload(); }</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2402.619</h4>
|
||||
<h4>Versione: 6.16.2402.1909</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2402.619
|
||||
6.16.2402.1909
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2402.619</version>
|
||||
<version>6.16.2402.1909</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"ImgBasePath": "https://iis01.egalware.com/MP/images/macchine/small/",
|
||||
"ImgStBasePath": "C:\\Steamware\\images\\ST",
|
||||
"CodModulo": "MoonPro",
|
||||
"samplerMaxCall": 10
|
||||
"samplerMaxCall": 15
|
||||
},
|
||||
"AlarmDest": "samuele.locatelli@egalware.com, ceo@steamware.net",
|
||||
"MailKitMailSettings": {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Services
|
||||
{
|
||||
public class ReloadEventArgs : EventArgs
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public ReloadEventArgs(string messaggio)
|
||||
{
|
||||
this.ReloadMessage = messaggio;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public string ReloadMessage { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,25 @@ namespace MP.Data.Services
|
||||
{
|
||||
public class TabDataService : BaseServ, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Evento richiesta rilettura dati pagina (x refresh pagine aperte)
|
||||
/// </summary>
|
||||
public event EventHandler ReloadRequest = delegate { };
|
||||
|
||||
/// <summary>
|
||||
/// Invio notifica rilettura (con parametro)
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
public void NotifyReloadRequest(string message)
|
||||
{
|
||||
if (ReloadRequest != null)
|
||||
{
|
||||
// messaggio
|
||||
ReloadEventArgs rea = new ReloadEventArgs(message);
|
||||
ReloadRequest.Invoke(this, rea);
|
||||
}
|
||||
}
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
@@ -3241,7 +3260,8 @@ namespace MP.Data.Services
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
|
||||
// notifico update ai client in ascolto x reset cache
|
||||
NotifyReloadRequest($"FlushRedisCache | {pattern}");
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -3405,4 +3425,5 @@ namespace MP.Data.Services
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user