63 lines
1.8 KiB
C#
63 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Components;
|
|
using System.Net.Http;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
using Microsoft.AspNetCore.Components.Forms;
|
|
using Microsoft.AspNetCore.Components.Routing;
|
|
using Microsoft.AspNetCore.Components.Web;
|
|
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
|
using Microsoft.JSInterop;
|
|
using MP.MONO.UI;
|
|
using MP.MONO.Data.DTO;
|
|
using MP.MONO.UI.Shared;
|
|
using MP.MONO.UI.Components;
|
|
|
|
namespace MP.MONO.UI.Pages
|
|
{
|
|
|
|
public partial class Test
|
|
{
|
|
[Inject]
|
|
private IJSRuntime JSRuntime { get; set; } = null!;
|
|
protected int _numHourPrev = 24;
|
|
protected int numHourPrev
|
|
{
|
|
get => _numHourPrev;
|
|
set
|
|
{
|
|
_numHourPrev = value;
|
|
var pUpd = Task.Run(async () =>
|
|
{
|
|
await ReloadData();
|
|
});
|
|
pUpd.Wait();
|
|
}
|
|
}
|
|
protected int totalCount = 0;
|
|
protected int totalEvents = 0;
|
|
protected List<AlarmFreqDTO> ListRecords = new List<AlarmFreqDTO>();
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
|
|
await ReloadData();
|
|
}
|
|
private async void popover()
|
|
{
|
|
await JSRuntime.InvokeVoidAsync("pop");
|
|
}
|
|
private async Task ReloadData()
|
|
{
|
|
await Task.Delay(1);
|
|
DateTime adesso = DateTime.Now;
|
|
ListRecords = await MMDataService.AlarmRecGetParetoFreq(1, adesso.AddHours(-numHourPrev), adesso);
|
|
totalCount = ListRecords.Count;
|
|
totalEvents = ListRecords.Sum(x => x.EventCount);
|
|
await Task.Delay(1);
|
|
}
|
|
}
|
|
} |