Started refactoring to be compatible with the changed nuget packages and the mooncore changes

This commit is contained in:
2025-07-15 19:21:44 +02:00
parent b53140e633
commit 514f862a9d
71 changed files with 616 additions and 247 deletions

View File

@@ -25,14 +25,14 @@
{
[Parameter] public CreateServerRequest Request { get; set; }
private async Task<NodeAllocationDetailResponse[]> Loader()
private async Task<NodeAllocationResponse[]> Loader()
{
// Handle unselected node
if (Request.NodeId <= 0)
return [];
var items = await PagedData<NodeAllocationDetailResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<NodeAllocationDetailResponse>>(
var items = await PagedData<NodeAllocationResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<NodeAllocationResponse>>(
$"api/admin/servers/nodes/{Request.NodeId}/allocations/free?page={page}&pageSize={pageSize}"
)
);

View File

@@ -102,10 +102,10 @@
return items;
}
private async Task<NodeDetailResponse[]> LoadNodes()
private async Task<NodeResponse[]> LoadNodes()
{
var items = await PagedData<NodeDetailResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<NodeDetailResponse>>(
var items = await PagedData<NodeResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<NodeResponse>>(
$"api/admin/servers/nodes?page={page}&pageSize={pageSize}"
)
);

View File

@@ -1,3 +1,4 @@
@using MoonCore.Blazor.FlyonUi.Components
@using MoonlightServers.Shared.Http.Requests.Admin.Servers
@using MoonCore.Helpers
@using MoonCore.Blazor.Tailwind.Components

View File

@@ -1,3 +1,4 @@
@using MoonCore.Blazor.FlyonUi.Components
@using MoonCore.Blazor.Tailwind.Components
@using MoonlightServers.Shared.Enums
@using MoonlightServers.Shared.Http.Requests.Client.Servers.Shares

View File

@@ -1,3 +1,4 @@
@using MoonCore.Blazor.FlyonUi.Helpers
@using MoonlightServers.Frontend.Services
@using MoonCore.Blazor.Tailwind.Fm
@using MoonCore.Blazor.Tailwind.Services

View File

@@ -1,3 +1,5 @@
@using MoonCore.Blazor.FlyonUi.Alerts
@using MoonCore.Blazor.FlyonUi.Components
@using MoonCore.Blazor.Tailwind.Alerts
@using MoonCore.Helpers
@using MoonCore.Blazor.Tailwind.Components

View File

@@ -1,3 +1,7 @@
@using MoonCore.Blazor.FlyonUi.Alerts
@using MoonCore.Blazor.FlyonUi.Components
@using MoonCore.Blazor.FlyonUi.Modals
@using MoonCore.Blazor.FlyonUi.Toasts
@using MoonCore.Blazor.Tailwind.Alerts
@using MoonCore.Blazor.Tailwind.Components
@using MoonCore.Blazor.Tailwind.Modals

View File

@@ -1,3 +1,5 @@
@using MoonCore.Blazor.FlyonUi.Components
@using MoonCore.Blazor.FlyonUi.Toasts
@using MoonCore.Blazor.Tailwind.Components
@using MoonCore.Blazor.Tailwind.Toasts
@using MoonlightServers.Frontend.Services

View File

@@ -25,12 +25,12 @@
@code
{
[Parameter] public UpdateServerRequest Request { get; set; }
[Parameter] public ServerDetailResponse Server { get; set; }
[Parameter] public ServerResponse Server { get; set; }
private async Task<NodeAllocationDetailResponse[]> Loader()
private async Task<NodeAllocationResponse[]> Loader()
{
var items = await PagedData<NodeAllocationDetailResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<NodeAllocationDetailResponse>>(
var items = await PagedData<NodeAllocationResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<NodeAllocationResponse>>(
$"api/admin/servers/nodes/{Server.NodeId}/allocations/free?page={page}&pageSize={pageSize}&serverId={Server.Id}"
)
);

View File

@@ -1,3 +1,4 @@
@using MoonCore.Blazor.FlyonUi.Components
@using MoonlightServers.Shared.Http.Requests.Admin.Servers
@using MoonCore.Helpers
@using MoonCore.Blazor.Tailwind.Components
@@ -43,10 +44,10 @@
@code
{
[Parameter] public UpdateServerRequest Request { get; set; }
[Parameter] public ServerDetailResponse Server { get; set; }
[Parameter] public ServerResponse Server { get; set; }
private StarVariableDetailResponse[] StarVariables;
private ServerVariableDetailResponse[] Variables;
private ServerVariableResponse[] Variables;
private async Task Load(LazyLoader _)
{
@@ -56,14 +57,14 @@
)
);
Variables = await PagedData<ServerVariableDetailResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<ServerVariableDetailResponse>>(
Variables = await PagedData<ServerVariableResponse>.All(async (page, pageSize) =>
await ApiClient.GetJson<PagedData<ServerVariableResponse>>(
$"api/admin/servers/{Server.Id}/variables?page={page}&pageSize={pageSize}"
)
);
}
private async Task UpdateValue(ServerVariableDetailResponse serverVariable, ChangeEventArgs args)
private async Task UpdateValue(ServerVariableResponse serverVariable, ChangeEventArgs args)
{
var value = args.Value?.ToString() ?? "";

View File

@@ -1,3 +1,4 @@
@using MoonCore.Blazor.FlyonUi.Components
@using MoonCore.Blazor.Tailwind.Components
@using MoonlightServers.Shared.Enums
@using MoonlightServers.Shared.Http.Requests.Client.Servers.Shares