mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
Обновил модель базы данных
Слегка изменил сущности Добавил страницу в Web Сделал компонент с карточками для принетров
This commit is contained in:
1 parent
9cc166e37d
commit
24adf91ad9
16 files changed
+788
-21
No files matched your search
@@ -0,0 +1,53 @@
|
||||
@page "/Printers"
|
||||
@using CartriX.Web.Pages.PrintersPage.Components
|
||||
@inject HttpClient http
|
||||
|
||||
<style>
|
||||
.printer-grid {
|
||||
display: grid;
|
||||
margin-top: 8px;
|
||||
grid-template-columns: repeat(auto-fit, minmax(700px, 1fr));
|
||||
gap: 16px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
</style>
|
||||
|
||||
<RadzenStack AlignItems="AlignItems.Stretch">
|
||||
@foreach (var location in locationItems)
|
||||
{
|
||||
<RadzenPanel AllowCollapse="true" Style="padding: 8px;">
|
||||
<HeaderTemplate>
|
||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
|
||||
<RadzenText Text="@($"{location.Name}")" TextStyle="TextStyle.DisplayH6" />
|
||||
<RadzenBadge Text="@($"Количесво принтеров: {location.Printers.Count}")" />
|
||||
</RadzenStack>
|
||||
</HeaderTemplate>
|
||||
<ChildContent>
|
||||
<div class="printer-grid">
|
||||
@foreach (var printer in location.Printers)
|
||||
{
|
||||
<PrinterCard Printer="printer" />
|
||||
}
|
||||
</div>
|
||||
</ChildContent>
|
||||
</RadzenPanel>
|
||||
}
|
||||
</RadzenStack>
|
||||
|
||||
@code {
|
||||
|
||||
List<Shared.Models.Location.LocationItem> locationItems = new();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await GetLocations();
|
||||
}
|
||||
|
||||
async Task GetLocations()
|
||||
{
|
||||
var responce = await http.GetAsync(Shared.Classes.ApiRoutes.Location.List);
|
||||
var json = await responce.Content.ReadAsStringAsync();
|
||||
var result = JsonConvert.DeserializeObject<List<Shared.Models.Location.LocationItem>>(json);
|
||||
locationItems = result!;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user