LANCommander/LANCommander.Server/UI/Pages/Servers/Edit/Scripts.razor

35 lines
No EOL
1.3 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>
<ScriptEditor ServerId="@context.Id" ArchiveId="@context.Game.Archives.OrderByDescending(a => a.CreatedOn).FirstOrDefault().Id" AllowedTypes="new[] { ScriptType.BeforeStart, ScriptType.AfterStop, ScriptType.GameStarted, ScriptType.GameStopped }" />
</ChildContent>
</ServerEditView>
@code {
[Parameter] public Guid Id { get; set; }
}