2025-01-22 18:31:56 -06:00
@page "/Servers/{id:guid}/HTTP"
@using LANCommander.Server.UI.Pages.Servers.Components
2025-02-01 02:21:34 -06:00
@inject ServerService ServerService
2025-01-22 18:31:56 -06:00
@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" />
2026-02-08 15:03:15 -06:00
2026-06-12 23:48:11 -05:00
<Button Type="ButtonType.Primary" OnClick="() => _httpPathEditor?.Save()">Save</Button>
2025-01-22 18:31:56 -06:00
</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>
2026-02-08 15:03:15 -06:00
<ServerHttpPathEditor @ref="_httpPathEditor" ServerId="Id" WorkingDirectory="@context.WorkingDirectory" />
2025-01-22 18:31:56 -06:00
</ChildContent>
</ServerEditView>
@code {
[Parameter] public Guid Id { get; set; }
2026-02-08 15:03:15 -06:00
ServerHttpPathEditor _httpPathEditor;
2025-01-22 18:31:56 -06:00
async Task Save(Server server)
{
try
{
2025-02-01 02:21:34 -06:00
server = await ServerService.UpdateAsync(server);
2025-01-22 18:31:56 -06:00
2025-05-23 02:17:45 -05:00
await MessageService.SuccessAsync("HTTP paths updated!");
2025-01-22 18:31:56 -06:00
}
catch (Exception ex)
{
MessageService.Error("Could not save!");
Logger.LogError(ex, "Could not save!");
}
}
}