Files
mapo-core/MP.IOC/Components/Pages/Index.razor.cs
T

33 lines
1021 B
C#

using Microsoft.AspNetCore.Components;
using MP.Data.DbModels.Utils;
using MP.Data.Services.Utils;
namespace MP.IOC.Components.Pages
{
public partial class Index
{
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
private async Task ReloadData()
{
DateTime oggi = DateTime.Today;
DateTime adesso = DateTime.Now;
var rawData = await StatsAggrService.GetFiltAsync(oggi.AddDays(-5), oggi);
ListGlobalCall = rawData.OrderByDescending(x => x.Hour).ToList();
ListParetoCall = await StatsDetService.GetParetoAsync(adesso.AddHours(-1), adesso, 5);
}
private List<StatsAggregatedModel> ListGlobalCall = new();
private List<StatsDetailModel> ListParetoCall = new();
[Inject]
private IStatsAggrService StatsAggrService { get; set; } = null!;
[Inject]
private IStatsDetailService StatsDetService { get; set; } = null!;
}
}