- Regenerate migrations - Fix identity database context lifetimes - Fix rendering of edit components - Move database settings to separate section
44 lines
No EOL
1.5 KiB
Text
44 lines
No EOL
1.5 KiB
Text
@page "/Servers/{id:guid}/HTTP"
|
|
@using LANCommander.Server.UI.Pages.Servers.Components
|
|
@inject ServerService ServerService
|
|
@inject IMessageService MessageService
|
|
@inject ILogger<General> Logger
|
|
|
|
<ServerEditView Id="Id" Title="HTTP Paths">
|
|
<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" />
|
|
|
|
<Button Type="ButtonType.Primary" OnClick="() => _httpPathEditor?.Save()">Save</Button>
|
|
</Flex>
|
|
}
|
|
</TitleExtraTemplate>
|
|
|
|
<ChildContent>
|
|
<Text>HTTP paths are a way to host static files such as maps and other assets. Engines such as Source, id Tech 3, and Unreal can utilize HTTP for faster downloads when connecting to a server.</Text>
|
|
<ServerHttpPathEditor @ref="_httpPathEditor" ServerId="Id" WorkingDirectory="@context.WorkingDirectory" />
|
|
</ChildContent>
|
|
</ServerEditView>
|
|
|
|
@code {
|
|
[Parameter] public Guid Id { get; set; }
|
|
|
|
ServerHttpPathEditor _httpPathEditor;
|
|
|
|
async Task Save(Server server)
|
|
{
|
|
try
|
|
{
|
|
server = await ServerService.UpdateAsync(server);
|
|
|
|
await MessageService.SuccessAsync("HTTP paths updated!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageService.Error("Could not save!");
|
|
Logger.LogError(ex, "Could not save!");
|
|
}
|
|
}
|
|
} |