Added current tab as query parameter to system page

This commit is contained in:
2025-12-30 16:07:08 +01:00
parent f71bad3da3
commit b79c8fe476

View File

@@ -1,4 +1,5 @@
@page "/admin/system"
@using LucideBlazor
@using ShadcnBlazor.Buttons
@using ShadcnBlazor.Cards
@@ -6,7 +7,9 @@
@using ShadcnBlazor.Tab
@using ShadcnBlazor.Labels
<Tabs DefaultValue="customization">
@inject NavigationManager Navigation
<Tabs DefaultValue="@(Tab ?? "customization")" OnValueChanged="OnTabChanged">
<TabsList ClassName="inline-flex w-full lg:w-fit justify-start overflow-x-auto overflow-y-hidden">
<TabsTrigger Value="customization">
<PaintRollerIcon />
@@ -42,4 +45,16 @@
<TabsContent Value="diagnose">
<Diagnose />
</TabsContent>
</Tabs>
</Tabs>
@code
{
[SupplyParameterFromQuery(Name = "tab")]
[Parameter]
public string? Tab { get; set; }
private void OnTabChanged(string name)
{
Navigation.NavigateTo($"/admin/system?tab={name}");
}
}