Updated the usage of mooncore components

This commit is contained in:
2025-02-05 16:52:49 +01:00
parent 0b143d1c81
commit b423b9fa19
24 changed files with 368 additions and 338 deletions

View File

@@ -1,7 +1,6 @@
@page "/admin/servers/all/update/{Id:int}"
@using MoonCore.Blazor.Tailwind.Components
@using MoonCore.Blazor.Tailwind.Forms
@using MoonCore.Blazor.Tailwind.Toasts
@using MoonCore.Helpers
@using MoonlightServers.Shared.Http.Requests.Admin.Servers
@@ -14,10 +13,10 @@
<LazyLoader Load="Load">
<PageHeader Title="Update Server">
<button @onclick="GoBack" type="button" class="btn btn-secondary">
<a href="/admin/servers/all" class="btn btn-secondary">
<i class="icon-chevron-left mr-1"></i>
Back
</button>
</a>
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
<i class="icon-check mr-1"></i>
Update
@@ -62,10 +61,7 @@
{
await ApiClient.Patch($"api/admin/servers/{Id}", Request);
await ToastService.Success("Successfully updated Server");
GoBack();
await ToastService.Success("Successfully updated server");
Navigation.NavigateTo("/admin/servers/all");
}
private void GoBack()
=> Navigation.NavigateTo(ComponentHelper.GetRouteOfComponent<Index>()!);
}