Added allocations to server update

This commit is contained in:
2024-12-21 13:14:09 +01:00
parent 0baf9668f9
commit 2b697dffb7
4 changed files with 46 additions and 12 deletions

View File

@@ -29,16 +29,12 @@
private async Task<NodeAllocationDetailResponse[]> Loader()
{
// Handle unselected node
if (Server.NodeId <= 0)
return [];
var items = await PagedData<NodeAllocationDetailResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<NodeAllocationDetailResponse>>(
$"api/admin/servers/nodes/{Server.NodeId}/allocations/free?page={page}&pageSize={pageSize}"
$"api/admin/servers/nodes/{Server.NodeId}/allocations/free?page={page}&pageSize={pageSize}&serverId={Server.Id}"
)
);
return items;
}
}

View File

@@ -54,7 +54,7 @@
private async Task Load(LazyLoader _)
{
var Server = await ApiClient.GetJson<ServerDetailResponse>($"api/admin/servers/{Id}");
Server = await ApiClient.GetJson<ServerDetailResponse>($"api/admin/servers/{Id}");
Request = Mapper.Map<UpdateServerRequest>(Server);
}