Крче много чего сдлелал, я похерил коммиты и комментарий соотвествощий

>:(
This commit is contained in:
Hukuta committed 2026-05-03 09:56:17 +09:00
1 parent c39880ab68
commit 7a0e7e0801
20 files changed
+417 -48

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
@inherits LayoutComponentBase
<RadzenLayout>
<RadzenHeader>
<RadzenLabel>Logo</RadzenLabel>
<h1>Logo</h1>
</RadzenHeader>
<Sidebar />
<RadzenBody>
+3 -19
View File
@@ -8,9 +8,6 @@
<RadzenPanelMenu>
<RadzenPanelMenuItem Text="Панель управления" Icon="home" Click="@(() => ClickToDashboard())" />
<RadzenPanelMenuItem Text="Устройства" Icon="Print" Expanded="true">
<RadzenPanelMenuItem Text="Новое местоположение" Icon="Add" Click="@(() => ClickToAddLocation())" />
<RadzenPanelMenuItem Text="Новое устройство" Icon="Add" />
@foreach (PrintersAndLocations printersAndLocations in ListLocationsAndPrinters)
{
<RadzenPanelMenuItem Text="@printersAndLocations.Name" Icon="Label">
@@ -21,22 +18,18 @@
{
if (printer != null)
{
<RadzenPanelMenuItem Text="@printer.PrinterName" Icon="Print"
<RadzenPanelMenuItem Text="@printer.Hostname" Icon="Print"
Click="@(() => ClickToPrinter(printer.Id))" />
}
}
}
<RadzenPanelMenuItem Text="Новое устройство" Icon="Add" Click="@(() => NavigationManager.NavigateTo("/PrinterAdd"))" />
</RadzenPanelMenuItem>
}
<RadzenPanelMenuItem Text="Новое местоположение" Icon="Add" Click="@(() => ClickToAddLocation())" />
<RadzenTree Style="width: 100%; height: auto;">
</RadzenTree>
</RadzenPanelMenuItem>
<RadzenPanelMenuItem Text="Настройки" Icon="settings" />
</RadzenPanelMenu>
</RadzenSidebar>
@@ -46,29 +39,20 @@
public void ClickToDashboard() => NavigationManager.NavigateTo("/Dashboard");
public void ClickToPrinter(int Id) => NavigationManager.NavigateTo($"/PrinterPage/{Id}");
static readonly HttpClient client = new HttpClient();
List<PrintersAndLocations> ListLocationsAndPrinters = new List<PrintersAndLocations>();
protected override async Task OnInitializedAsync()
{
var url = "http://localhost:5197/api/Location/List";
try
{
var response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
var content = await response.Content.ReadAsStringAsync();
ListLocationsAndPrinters = JsonConvert.DeserializeObject<List<PrintersAndLocations>>(content)!;
}
catch (HttpRequestException e)
{
Console.WriteLine($"{e.Message}");
}
}
}