From 0743bad93c96859f6a6873ce7b0f4485ddbb9c5a Mon Sep 17 00:00:00 2001 From: mxritzdev Date: Tue, 13 May 2025 15:28:46 +0200 Subject: [PATCH] added ui for the diagnose system --- .../UI/Views/Admin/Sys/Diagnose.razor | 46 +++++++++++++++++++ Moonlight.Client/UiConstants.cs | 4 +- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 Moonlight.Client/UI/Views/Admin/Sys/Diagnose.razor diff --git a/Moonlight.Client/UI/Views/Admin/Sys/Diagnose.razor b/Moonlight.Client/UI/Views/Admin/Sys/Diagnose.razor new file mode 100644 index 00000000..079cf665 --- /dev/null +++ b/Moonlight.Client/UI/Views/Admin/Sys/Diagnose.razor @@ -0,0 +1,46 @@ +@page "/admin/system/diagnose" + +@using MoonCore.Attributes +@using MoonCore.Helpers + +@attribute [RequirePermission("admin.system.diagnose")] + +@inject HttpApiClient ApiClient +@inject DownloadService DownloadService + +
+ +
+ +
+
+
+ Diagnose +
+
+

+ If you're experiencing issues or need help via our Discord, you're in the right place here! + By pressing the button below, Moonlight will run all available diagnostic checks and package the results into a + downloadable zip file. + The report includes useful information about your system, plugins, and environment, making it easier to identify problems or share with support. +

+ + Generate diagnose +
+
+
+ +@code +{ + private async Task GenerateFrontend(WButton _) + { + var stream = await ApiClient.GetStream("api/admin/system/diagnose"); + + await DownloadService.DownloadStream("diagnose.zip", stream); + } +} + + +@code { + +} \ No newline at end of file diff --git a/Moonlight.Client/UiConstants.cs b/Moonlight.Client/UiConstants.cs index 9293cc7f..dce82611 100644 --- a/Moonlight.Client/UiConstants.cs +++ b/Moonlight.Client/UiConstants.cs @@ -4,12 +4,12 @@ public static class UiConstants { public static readonly string[] AdminNavNames = [ - "Overview", "Theme", "Files", "Hangfire", "Advanced" + "Overview", "Theme", "Files", "Hangfire", "Advanced", "Diagnose" ]; public static readonly string[] AdminNavLinks = [ "/admin/system", "/admin/system/theme", "/admin/system/files", "/admin/system/hangfire", - "/admin/system/advanced" + "/admin/system/advanced", "/admin/system/diagnose" ]; } \ No newline at end of file