mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 04:20:55 +00:00
46 lines
1.5 KiB
Plaintext
46 lines
1.5 KiB
Plaintext
@page "/"
|
|
@page "/Dashboard"
|
|
@using Microsoft.AspNetCore.Authorization
|
|
@attribute [Authorize(Roles = "Administrator")]
|
|
|
|
@inject HttpClient httpClient
|
|
|
|
<RadzenCard Variant="Variant.Flat">
|
|
<RadzenStack>
|
|
<RadzenLabel />
|
|
<RadzenChart>
|
|
<RadzenAreaSeries Smooth="false"
|
|
Data="@dataPerPrinteds"
|
|
Interpolation="Interpolation.Spline"
|
|
CategoryProperty="DateString"
|
|
LineType="LineType.Solid"
|
|
ValueProperty="countPrinted"
|
|
Title="Страниц распечатано">
|
|
<RadzenCategoryAxis LabelRotation="45"/>
|
|
<RadzenLegend Visible="false"/>
|
|
<RadzenMarkers Visible="true" MarkerType="MarkerType.Auto"/>
|
|
<RadzenSeriesDataLabels Visible="@(dataPerPrinteds?.Any() ?? false)" />
|
|
</RadzenAreaSeries>
|
|
</RadzenChart>
|
|
</RadzenStack>
|
|
</RadzenCard>
|
|
|
|
|
|
@code {
|
|
List<DTOs.PrinterCounterRecord.noId>? dataPerPrinteds;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
var response = await httpClient.GetAsync(ApiRoutes.Report.GetReportToDatePerCountPrinted);
|
|
dataPerPrinteds = JsonConvert.DeserializeObject<List<DTOs.PrinterCounterRecord.noId>>(await response.Content.ReadAsStringAsync());
|
|
|
|
dataPerPrinteds = dataPerPrinteds?.OrderBy(x => x.date).ToList();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|