LANCommander/LANCommander.Server/UI/Pages/Servers/Edit/Scripts.razor
Pat Hartl 20731f355a Fix certain taxonomies (tag, genre, platform) being removed from game on save
Fixes the action, custom field, multiplayer mode, and save path editors from clearing out taxonomies when saving. Also passes the Game/Server/Redistributable ID as a cascading parameter.
2025-12-08 00:51:32 -06:00

37 lines
No EOL
1.4 KiB
Text

@page "/Servers/{id:guid}/Scripts"
@using LANCommander.SDK.Enums
@using LANCommander.Server.UI.Pages.Servers.Components
<ServerEditView Id="Id" Title="Scripts">
<TitleExtraTemplate>
@if (context != null && context.Id != Guid.Empty)
{
<Flex Align="FlexAlign.Center" Justify="FlexJustify.End" Wrap="FlexWrap.NoWrap" Gap="FlexGap.Small">
<ServerControl ServerId="context.Id" />
<Dropdown Trigger="@(new Trigger[] { Trigger.Click })">
<Overlay>
<Menu>
<MenuItem>
<a href="/Server/@(context.Id)/Export/Full" target="_blank">Full</a>
</MenuItem>
</Menu>
</Overlay>
<ChildContent>
<Button>Export</Button>
</ChildContent>
</Dropdown>
</Flex>
}
</TitleExtraTemplate>
<ChildContent>
<CascadingValue Name="ServerId" Value="context.Id">
<ScriptEditor ArchiveId="@context.Game.Archives.OrderByDescending(a => a.CreatedOn).FirstOrDefault().Id" AllowedTypes="new[] { ScriptType.BeforeStart, ScriptType.AfterStop, ScriptType.GameStarted, ScriptType.GameStopped }"/>
</CascadingValue>
</ChildContent>
</ServerEditView>
@code {
[Parameter] public Guid Id { get; set; }
}