Reload pagina anche su PlantStatus
This commit is contained in:
@@ -323,6 +323,8 @@ namespace GWMS.UI.Pages
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,11 @@ using GWMS.UI.Data;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.JSInterop;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.UI.Pages
|
||||
@@ -18,6 +17,7 @@ namespace GWMS.UI.Pages
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer;
|
||||
private PlantDTO currRecord = null;
|
||||
|
||||
private List<PlantDTO> ListRecords;
|
||||
@@ -35,6 +35,9 @@ namespace GWMS.UI.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private IConfiguration Configuration { get; set; }
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private bool ShowCharts { get; set; } = false;
|
||||
@@ -131,6 +134,7 @@ namespace GWMS.UI.Pages
|
||||
MessageService.PageName = "Impianti";
|
||||
MessageService.PageIcon = "fas fa-tachometer-alt pr-2";
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
StartTimer();
|
||||
await ReloadAllData();
|
||||
}
|
||||
|
||||
@@ -152,15 +156,37 @@ namespace GWMS.UI.Pages
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
}
|
||||
|
||||
public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await ReloadAllData();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
public async void OnSeachUpdated()
|
||||
{
|
||||
await UpdateData();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
int tOutPeriod = 3000;
|
||||
int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(tOutPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@
|
||||
"ChartWaitDelay": 10,
|
||||
"logo": "img/LogoPizzaferri.jpg",
|
||||
"ReloadParamTimer": 5000,
|
||||
"ReloadStatusTimer": 5000,
|
||||
"ExternalProviders": {
|
||||
"MailKit": {
|
||||
"SMTP": {
|
||||
|
||||
Reference in New Issue
Block a user