Cleaned up using in project. Improved prohect structure and refactored page names. Upgraded dependencies
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
|
||||
private CreateApiKeyDto Request;
|
||||
|
||||
private readonly List<string> Permissions = new();
|
||||
private readonly List<string> Permissions = [];
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
@@ -88,7 +88,7 @@
|
||||
}
|
||||
|
||||
await ToastService.SuccessAsync(
|
||||
"API Key creation",
|
||||
"API Key Creation",
|
||||
$"Successfully created API key {Request.Name}"
|
||||
);
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
@using ShadcnBlazor.Extras.Dialogs
|
||||
@using ShadcnBlazor.Extras.Toasts
|
||||
@using ShadcnBlazor.Tabels
|
||||
@using SerializationContext = Moonlight.Shared.SerializationContext
|
||||
|
||||
@inject ToastService ToastService
|
||||
@inject DialogService DialogService
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
}
|
||||
|
||||
await ToastService.SuccessAsync(
|
||||
"API Key update",
|
||||
"API Key Update",
|
||||
$"Successfully updated API key {Request.Name}"
|
||||
);
|
||||
|
||||
|
||||
@@ -122,10 +122,10 @@
|
||||
|
||||
@code
|
||||
{
|
||||
private ContainerHelperStatusDto StatusDto;
|
||||
private string SelectedVersion = "v2.1";
|
||||
private bool NoBuildCache;
|
||||
|
||||
|
||||
private ContainerHelperStatusDto StatusDto;
|
||||
private VersionDto[] Versions;
|
||||
|
||||
private async Task LoadAsync(LazyLoader _)
|
||||
@@ -1,15 +1,16 @@
|
||||
@inherits ShadcnBlazor.Extras.Dialogs.DialogBase
|
||||
@using System.Text.Json
|
||||
@using LucideBlazor
|
||||
@using Moonlight.Shared
|
||||
@using Moonlight.Shared.Admin.Sys.ContainerHelper
|
||||
@using ShadcnBlazor.Buttons
|
||||
@using ShadcnBlazor.Dialogs
|
||||
@using ShadcnBlazor.Progresses
|
||||
@using ShadcnBlazor.Spinners
|
||||
@using SerializationContext = Moonlight.Shared.SerializationContext
|
||||
|
||||
@inject HttpClient HttpClient
|
||||
|
||||
@inherits ShadcnBlazor.Extras.Dialogs.DialogBase
|
||||
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
Updating instance to @Version...
|
||||
@@ -10,6 +10,7 @@
|
||||
@using ShadcnBlazor.Emptys
|
||||
@using ShadcnBlazor.Extras.Common
|
||||
@using ShadcnBlazor.Spinners
|
||||
|
||||
@inject HttpClient HttpClient
|
||||
@inject IAuthorizationService AuthorizationService
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
@using LucideBlazor
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@using Moonlight.Frontend.Admin.Sys.HelperContainer
|
||||
@using Moonlight.Frontend.Admin.Sys.Settings
|
||||
@using Moonlight.Shared
|
||||
@using ShadcnBlazor.Tab
|
||||
|
||||
@@ -36,7 +34,7 @@
|
||||
@if (SettingsResult.Succeeded)
|
||||
{
|
||||
<TabsContent Value="settings">
|
||||
<Settings/>
|
||||
<<Moonlight.Frontend.Admin.Sys.Settings.Index/>
|
||||
</TabsContent>
|
||||
}
|
||||
@if (DiagnoseResult.Succeeded)
|
||||
@@ -60,7 +58,7 @@
|
||||
@if (InstanceResult.Succeeded && VersionsResult.Succeeded)
|
||||
{
|
||||
<TabsContent Value="instance">
|
||||
<Instance/>
|
||||
<Moonlight.Frontend.Admin.Sys.ContainerHelper.Index/>
|
||||
</TabsContent>
|
||||
}
|
||||
</Tabs>
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
@page "/admin"
|
||||
|
||||
@using LucideBlazor
|
||||
@using Moonlight.Frontend.Infrastructure.Helpers
|
||||
@using Moonlight.Shared
|
||||
@using Moonlight.Shared.Admin.Sys
|
||||
@using ShadcnBlazor.Buttons
|
||||
@using ShadcnBlazor.Cards
|
||||
@using ShadcnBlazor.Extras.Dialogs
|
||||
@using ShadcnBlazor.Spinners
|
||||
@using SerializationContext = Moonlight.Shared.SerializationContext
|
||||
|
||||
@inject HttpClient HttpClient
|
||||
@inject DialogService DialogService
|
||||
|
||||
<h1 class="text-xl font-semibold">Overview</h1>
|
||||
<div class="text-muted-foreground">
|
||||
|
||||
@@ -5,21 +5,28 @@ namespace Moonlight.Frontend.Admin.Sys.Settings;
|
||||
|
||||
public class SystemSettingsOptions
|
||||
{
|
||||
private readonly List<SystemSettingsPage> InnerComponents = new();
|
||||
public IReadOnlyList<SystemSettingsPage> Components => InnerComponents;
|
||||
|
||||
private readonly List<SystemSettingsPage> InnerComponents = [];
|
||||
|
||||
public void Add<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TIcon,
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
|
||||
TComponent>(string name, string description,
|
||||
int order)
|
||||
where TIcon : ComponentBase where TComponent : ComponentBase
|
||||
int order
|
||||
) where TIcon : ComponentBase where TComponent : ComponentBase
|
||||
{
|
||||
Add(name, description, order, typeof(TIcon), typeof(TComponent));
|
||||
}
|
||||
|
||||
public void Add(string name, string description, int order,
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type iconComponent,
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type component)
|
||||
public void Add(
|
||||
string name,
|
||||
string description,
|
||||
int order,
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
|
||||
Type iconComponent,
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
|
||||
Type component
|
||||
)
|
||||
{
|
||||
InnerComponents.Add(new SystemSettingsPage(name, description, order, iconComponent, component));
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
@using LucideBlazor
|
||||
@using Moonlight.Frontend.Infrastructure.Helpers
|
||||
@using Moonlight.Frontend.Shared.Frontend
|
||||
@using Moonlight.Shared
|
||||
@using Moonlight.Shared.Admin.Sys.Settings
|
||||
@using ShadcnBlazor.Extras.Common
|
||||
@using ShadcnBlazor.Extras.Forms
|
||||
@using ShadcnBlazor.Extras.Toasts
|
||||
@using ShadcnBlazor.Fields
|
||||
@using ShadcnBlazor.Inputs
|
||||
@using SerializationContext = Moonlight.Shared.SerializationContext
|
||||
|
||||
@inject HttpClient HttpClient
|
||||
@inject ToastService ToastService
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/admin/system/themes/create"
|
||||
|
||||
@using LucideBlazor
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Moonlight.Frontend.Infrastructure.Helpers
|
||||
@@ -13,7 +14,6 @@
|
||||
@using ShadcnBlazor.Fields
|
||||
@using ShadcnBlazor.Inputs
|
||||
@using ShadcnBlazor.Switches
|
||||
@using SerializationContext = Moonlight.Shared.SerializationContext
|
||||
|
||||
@attribute [Authorize(Policy = Permissions.Themes.Create)]
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
@using ShadcnBlazor.Extras.AlertDialogs
|
||||
@using ShadcnBlazor.Extras.Toasts
|
||||
@using ShadcnBlazor.Tabels
|
||||
@using SerializationContext = Moonlight.Shared.SerializationContext
|
||||
|
||||
@inject ToastService ToastService
|
||||
@inject NavigationManager Navigation
|
||||
@@ -142,20 +141,11 @@
|
||||
return new DataGridResponse<ThemeDto>(response!.Data, response.TotalLength);
|
||||
}
|
||||
|
||||
private void Create()
|
||||
{
|
||||
Navigation.NavigateTo("/admin/system/themes/create");
|
||||
}
|
||||
private void Create() => Navigation.NavigateTo("/admin/system/themes/create");
|
||||
|
||||
private void Edit(ThemeDto theme)
|
||||
{
|
||||
Navigation.NavigateTo($"/admin/system/themes/{theme.Id}");
|
||||
}
|
||||
private void Edit(ThemeDto theme) => Navigation.NavigateTo($"/admin/system/themes/{theme.Id}");
|
||||
|
||||
private void Download(ThemeDto theme)
|
||||
{
|
||||
Navigation.NavigateTo($"api/admin/themes/{theme.Id}/export", true);
|
||||
}
|
||||
private void Download(ThemeDto theme) => Navigation.NavigateTo($"api/admin/themes/{theme.Id}/export", true);
|
||||
|
||||
private async Task DeleteAsync(ThemeDto theme)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Moonlight.Frontend.Admin.Sys.Themes;
|
||||
[Mapper]
|
||||
[SuppressMessage("Mapper", "RMG020:No members are mapped in an object mapping")]
|
||||
[SuppressMessage("Mapper", "RMG012:No members are mapped in an object mapping")]
|
||||
public partial class ThemeMapper
|
||||
public static partial class ThemeMapper
|
||||
{
|
||||
public static partial UpdateThemeDto ToUpdate(ThemeDto theme);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/admin/system/themes/{Id:int}"
|
||||
|
||||
@using LucideBlazor
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Moonlight.Frontend.Infrastructure.Helpers
|
||||
@@ -14,7 +15,6 @@
|
||||
@using ShadcnBlazor.Fields
|
||||
@using ShadcnBlazor.Inputs
|
||||
@using ShadcnBlazor.Switches
|
||||
@using SerializationContext = Moonlight.Shared.SerializationContext
|
||||
|
||||
@attribute [Authorize(Policy = Permissions.Themes.Edit)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user