@page "/admin/system/customisation/themes/create" @using Moonlight.Client.Services @using Moonlight.Shared.Misc @using Moonlight.Client.UI.Components @using Moonlight.Shared.Http.Requests.Admin.Sys.Theme @inject ThemeService ThemeService @inject ToastService ToastService @inject NavigationManager NavigationManager Back Create
This field will be used for update checks
@code { private HandleForm Form; private CreateThemeRequest Request = new(); protected override void OnInitialized() { Request.Content = CreateDefault(); } private async Task OnValidSubmit() { await ThemeService.CreateAsync(Request); await ToastService.SuccessAsync("Successfully created theme"); NavigationManager.NavigateTo("/admin/system/customisation"); } private ApplicationTheme CreateDefault() { return new ApplicationTheme() { ColorBackground = "#0c0f18", ColorBase100 = "#1e2b47", ColorBase150 = "#1a2640", ColorBase200 = "#101a2e", ColorBase250 = "#0f1729", ColorBase300 = "#0c1221", ColorBaseContent = "#dde5f5", ColorPrimary = "#4f39f6", ColorPrimaryContent = "#dde5f5", ColorSecondary = "#354052", ColorSecondaryContent = "#dde5f5", ColorAccent = "#ad46ff", ColorAccentContent = "#dde5f5", ColorNeutral = "#dde5f5", ColorNeutralContent = "#09090b", ColorInfo = "#155dfc", ColorInfoContent = "#dde5f5", ColorSuccess = "#00a63e", ColorSuccessContent = "#dde5f5", ColorWarning = "#ffba00", ColorWarningContent = "#dde5f5", ColorError = "#ec003f", ColorErrorContent = "#dde5f5", RadiusSelector = 0.25f, RadiusField = 0.5f, RadiusBox = 0.5f, SizeSelector = 0.25f, SizeField = 0.25f, Border = 1f, Depth = 0, Noise = 0 }; } }