mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 12:30:55 +00:00
37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
@page "/Printers"
|
|
@using CartriX.Shared.DTOs.Location
|
|
@using CartriX.Shared.DTOs.Printer
|
|
|
|
<RadzenDataGrid Data="locations">
|
|
|
|
<Columns>
|
|
<RadzenDataGridColumn Title="Расположения" Property="@nameof(QueryToListLocationsAndPrintersDto.name)" Resizable="true"/>
|
|
</Columns>
|
|
|
|
<Template Context="location">
|
|
<RadzenDataGrid Data="location.printers">
|
|
<Columns>
|
|
<RadzenDataGridColumn title="Название принтера" Property="name"/>
|
|
<RadzenDataGridColumn title="Hostname" Property="hostname"/>
|
|
<RadzenDataGridColumn title="IP адрес" Property="ipAddress"/>
|
|
<RadzenDataGridColumn title="Модель" Property="modelName" />
|
|
</Columns>
|
|
</RadzenDataGrid>
|
|
</Template>
|
|
</RadzenDataGrid>
|
|
|
|
@code {
|
|
|
|
List<QueryToListLocationsAndPrintersDto> locations = null!;
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
await base.OnParametersSetAsync();
|
|
|
|
HttpClient client = new();
|
|
|
|
var response = await client.GetAsync("http://localhost:5197/api/Location/GetAll");
|
|
locations = JsonConvert.DeserializeObject<List<QueryToListLocationsAndPrintersDto>>(await response.Content.ReadAsStringAsync())!;
|
|
}
|
|
}
|