@page "/admin/system/customisation"
@using Microsoft.AspNetCore.Authorization
@using MoonCore.Blazor.FlyonUi.DataTables
@using MoonCore.Models
@using Moonlight.Client.Services
@using Moonlight.Shared.Http.Responses.Admin
@attribute [Authorize(Policy = "permissions:admin.system.theme")]
@inject ThemeService ThemeService
@inject AlertService AlertService
@inject ToastService ToastService
Themes
@context.Name
@if (context.IsEnabled)
{
}
Images & Logos
@code
{
private DataTable Table;
private async Task> LoadItems(PaginationOptions options)
=> await ThemeService.Get(options.Page, options.PerPage);
private async Task Delete(ThemeResponse response)
{
await AlertService.ConfirmDanger(
"Theme deletion",
$"Do you really want to delete the theme: {response.Name}",
async () =>
{
await ThemeService.Delete(response.Id);
await ToastService.Success("Successfully deleted theme");
await Table.Refresh();
}
);
}
}