Switched to database scheme seperation from MoonCores SingleDb. Updated mooncore versions. Updating to correct Async naming

This commit is contained in:
2025-09-21 16:44:01 +00:00
parent 86bec7f2ee
commit 3e87d5c140
93 changed files with 587 additions and 1583 deletions

View File

@@ -26,17 +26,17 @@
includes your installed theme and plugins. For more information, have a look at <a class="text-primary" href="https://help.moonlightpanel.xyz">our docs</a>
</p>
<WButton OnClick="GenerateFrontend" CssClasses="btn btn-primary mt-5">Generate frontend.zip</WButton>
<WButton OnClick="GenerateFrontendAsync" CssClasses="btn btn-primary mt-5">Generate frontend.zip</WButton>
</div>
</div>
</div>
@code
{
private async Task GenerateFrontend(WButton _)
private async Task GenerateFrontendAsync(WButton _)
{
var stream = await ApiClient.GetStream("api/admin/system/advanced/frontend");
await DownloadService.Download("frontend.zip", stream);
await DownloadService.DownloadAsync("frontend.zip", stream);
}
}

View File

@@ -30,7 +30,7 @@
<div class="my-8">
<DataGrid TGridItem="ThemeResponse"
ItemsProvider="ItemsProvider"
ItemsProvider="ItemsProviderAsync"
EnableFiltering="true"
EnablePagination="true">
@@ -105,7 +105,7 @@
{
private DataGrid<ThemeResponse> Grid;
private async Task<DataGridItemResult<ThemeResponse>> ItemsProvider(DataGridItemRequest request)
private async Task<DataGridItemResult<ThemeResponse>> ItemsProviderAsync(DataGridItemRequest request)
{
var query = $"?startIndex={request.StartIndex}&count={request.Count}";
@@ -142,13 +142,13 @@
{
if (!file.Name.EndsWith(".json"))
{
await ToastService.Error($"Unable to import {file.Name}", "Only .json files are supported");
await ToastService.ErrorAsync($"Unable to import {file.Name}", "Only .json files are supported");
continue;
}
if (file.Size > maxFileSize)
{
await ToastService.Error($"Unable to import {file.Name}", "Exceeded the maximum file limit of 1MB");
await ToastService.ErrorAsync($"Unable to import {file.Name}", "Exceeded the maximum file limit of 1MB");
continue;
}
@@ -159,7 +159,7 @@
if (themeTransfer == null)
{
await ToastService.Error($"Unable to import {file.Name}", "Failed to deserialize the content");
await ToastService.ErrorAsync($"Unable to import {file.Name}", "Failed to deserialize the content");
continue;
}
@@ -173,7 +173,7 @@
Version = themeTransfer.Version
});
await ToastService.Success("Successfully imported theme", theme.Name);
await ToastService.SuccessAsync("Successfully imported theme", theme.Name);
await Grid.RefreshAsync();
}
@@ -203,19 +203,19 @@
var fileName = $"{transfer.Name.Replace(" ", string.Empty).Trim()}.json";
await DownloadService.Download(fileName, json);
await DownloadService.DownloadAsync(fileName, json);
}
private async Task DeleteAsync(ThemeResponse response)
{
await AlertService.ConfirmDanger(
await AlertService.ConfirmDangerAsync(
"Theme deletion",
$"Do you really want to delete the theme: {response.Name}",
async () =>
{
await ThemeService.DeleteAsync(response.Id);
await ToastService.Success("Successfully deleted theme");
await ToastService.SuccessAsync("Successfully deleted theme");
await Grid.RefreshAsync();
}
);

View File

@@ -14,7 +14,7 @@
<i class="icon-chevron-left"></i>
Back
</a>
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
<WButton OnClick="Form.SubmitAsync" CssClasses="btn btn-primary">
<i class="icon-check"></i>
Create
</WButton>
@@ -59,7 +59,7 @@
private async Task OnValidSubmit()
{
await ThemeService.CreateAsync(Request);
await ToastService.Success("Successfully created theme");
await ToastService.SuccessAsync("Successfully created theme");
NavigationManager.NavigateTo("/admin/system/customisation");
}

View File

@@ -9,13 +9,13 @@
@inject ToastService ToastService
@inject NavigationManager Navigation
<LazyLoader Load="Load">
<LazyLoader Load="LoadAsync">
<PageHeader Title="@($"Update {Request.Name}")">
<a href="/admin/system/customisation" class="btn btn-secondary">
<i class="icon-chevron-left"></i>
Back
</a>
<WButton OnClick="_ => Form.Submit()" CssClasses="btn btn-primary">
<WButton OnClick="Form.SubmitAsync" CssClasses="btn btn-primary">
<i class="icon-check"></i>
Update
</WButton>
@@ -80,7 +80,7 @@
private HandleForm Form;
private async Task Load(LazyLoader _)
private async Task LoadAsync(LazyLoader _)
{
Response = await ThemeService.GetAsync(Id);
@@ -100,7 +100,7 @@
{
await ThemeService.UpdateAsync(Id, Request);
await ToastService.Success("Successfully updated theme");
await ToastService.SuccessAsync("Successfully updated theme");
Navigation.NavigateTo("/admin/system/customisation");
}
}

View File

@@ -28,11 +28,11 @@
If you only want to export specific parts of the diagnose report, click on "Advanced" and select the desired providers
</p>
<WButton OnClick="GenerateDiagnose" CssClasses="btn btn-primary my-5">Generate report</WButton>
<WButton OnClick="GenerateDiagnoseAsync" CssClasses="btn btn-primary my-5">Generate report</WButton>
<div class="text-sm">
<a class="text-primary cursor-pointer flex items-center" @onclick:preventDefault
@onclick="ToggleDropDown">
@onclick="ToggleDropDownAsync">
<span class="me-1.5">Advanced</span>
@if (DropdownOpen)
{
@@ -45,7 +45,7 @@
</a>
<div class="@(DropdownOpen ? "" : "hidden")">
<LazyLoader Load="Load">
<LazyLoader Load="LoadAsync">
<div class="mb-2 py-2 border-b border-base-content/70 flex items-center gap-3">
<input id="selectall_checkbox" @bind="SelectAll" type="checkbox" class="checkbox checkbox-primary checkbox-xs">
<label for="selectall_checkbox">Select all</label>
@@ -86,7 +86,7 @@
}
}
private async Task Load(LazyLoader arg)
private async Task LoadAsync(LazyLoader arg)
{
var providers = await ApiClient.GetJson<DiagnoseProvideResponse[]>(
"api/admin/system/diagnose/providers"
@@ -96,7 +96,7 @@
.ToDictionary(x => x, _ => true);
}
private async Task GenerateDiagnose(WButton button)
private async Task GenerateDiagnoseAsync(WButton button)
{
var request = new GenerateDiagnoseRequest();
@@ -111,11 +111,11 @@
var stream = await ApiClient.PostStream("api/admin/system/diagnose", request);
await DownloadService.Download("diagnose.zip", stream);
await DownloadService.DownloadAsync("diagnose.zip", stream);
}
private async Task ToggleDropDown()
private async Task ToggleDropDownAsync()
{
DropdownOpen = !DropdownOpen;
await InvokeAsync(StateHasChanged);

View File

@@ -19,7 +19,7 @@
</HelperMessage>
</div>
<LazyLoader Load="Load">
<LazyLoader Load="LoadAsync">
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-4 gap-5">
<StatCard Title="Servers" Text="@Stats.Servers.ToString()" Icon="icon-server"/>
<StatCard Title="Recurring" Text="@Stats.Recurring.ToString()" Icon="icon-calendar-sync"/>
@@ -39,7 +39,7 @@
{
private HangfireStatsResponse Stats;
private async Task Load(LazyLoader _)
private async Task LoadAsync(LazyLoader _)
{
Stats = await ApiClient.GetJson<HangfireStatsResponse>(
"api/admin/system/hangfire/stats"

View File

@@ -13,7 +13,7 @@
<NavTabs Index="0" Names="UiConstants.AdminNavNames" Links="UiConstants.AdminNavLinks" />
</div>
<LazyLoader Load="LoadOverview">
<LazyLoader Load="LoadOverviewAsync">
<div class="gap-5 grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-4">
<StatCard Title="CPU Usage" Text="@(OverviewData.CpuUsage + "%")" Icon="icon-cpu"/>
<StatCard Title="Memory Usage" Text="@(Formatter.FormatSize(OverviewData.MemoryUsage))" Icon="icon-memory-stick"/>
@@ -28,7 +28,7 @@
<div class="flex">
<div class="card card-body">
<div class="flex justify-center">
<WButton OnClick="Restart" CssClasses="btn btn-error w-full">
<WButton OnClick="RestartAsync" CssClasses="btn btn-error w-full">
<i class="icon-repeat me-2"></i>
Restart/Shutdown
</WButton>
@@ -41,12 +41,12 @@
{
private SystemOverviewResponse OverviewData;
private async Task LoadOverview(LazyLoader arg)
private async Task LoadOverviewAsync(LazyLoader arg)
{
OverviewData = await ApiClient.GetJson<SystemOverviewResponse>("api/admin/system");
}
private async Task Restart(WButton _)
private async Task RestartAsync(WButton _)
{
await ApiClient.Post("api/admin/system/shutdown");
}