Renamed SharedSerializationContext to SerializationContext. Added error handling and no build cache functionality

This commit is contained in:
2026-01-29 13:59:24 +01:00
parent 8181404f0c
commit 660319afec
10 changed files with 109 additions and 37 deletions

View File

@@ -10,6 +10,7 @@
@using ShadcnBlazor.Extras.Dialogs
@using ShadcnBlazor.Fields
@using ShadcnBlazor.Selects
@using ShadcnBlazor.Switches
@inject HttpClient HttpClient
@inject DialogService DialogService
@@ -30,9 +31,7 @@
<FieldGroup>
<FieldSet>
<Field>
<FieldLabel>
Version
</FieldLabel>
<FieldLabel>Version / Branch</FieldLabel>
<FieldContent>
<Select DefaultValue="@SelectedVersion" @bind-Value="SelectedVersion">
<SelectTrigger ClassName="w-64">
@@ -40,12 +39,19 @@
</SelectTrigger>
<SelectContent ClassName="w-64">
<SelectItem Value="v2.1">v2.1</SelectItem>
<SelectItem Value="v2.1.1">v2.1.1</SelectItem>
<SelectItem Value="feat/ContainerHelper">feat/ContainerHelper
</SelectItem>
</SelectContent>
</Select>
</FieldContent>
</Field>
<Field>
<FieldLabel>Bypass Build Cache</FieldLabel>
<FieldContent>
<Switch @bind-Value="NoBuildCache" />
</FieldContent>
</Field>
</FieldSet>
<Field Orientation="FieldOrientation.Horizontal">
<Button @onclick="AskApplyAsync">Apply</Button>
@@ -110,6 +116,7 @@
{
private ContainerHelperStatusDto StatusDto;
private string SelectedVersion = "v2.1";
private bool NoBuildCache;
private async Task LoadAsync(LazyLoader _)
{
@@ -119,7 +126,11 @@
private async Task ApplyAsync()
{
await DialogService.LaunchAsync<UpdateInstanceModal>(
parameters => { parameters[nameof(UpdateInstanceModal.Version)] = SelectedVersion; },
parameters =>
{
parameters[nameof(UpdateInstanceModal.Version)] = SelectedVersion;
parameters[nameof(UpdateInstanceModal.NoBuildCache)] = NoBuildCache;
},
onConfigure: model =>
{
model.ShowCloseButton = false;
@@ -130,17 +141,17 @@
private async Task AskApplyAsync()
{
if(string.IsNullOrWhiteSpace(SelectedVersion))
if (string.IsNullOrWhiteSpace(SelectedVersion))
return;
var shouldContinue = await ConfirmRiskyVersionAsync(
"Moonlight Rebuild",
"If you continue the moonlight instance will become unavailable during the rebuild process. This will impact users on this instance"
);
if(!shouldContinue)
if (!shouldContinue)
return;
if (!Regex.IsMatch(SelectedVersion, @"^v\d+(\.\d+)*b?$"))
{
shouldContinue = await ConfirmRiskyVersionAsync(
@@ -163,7 +174,7 @@
if (!shouldContinue)
return;
await ApplyAsync();
}