@page "/session/{SessionId:guid}/history" @using GmRelay.Web.Services @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Components.Authorization @attribute [Authorize] @inject AuthorizedSessionService SessionService @inject AuthenticationStateProvider AuthStateProvider @inject NavigationManager Navigation История изменений — GM-Relay
@if (entries is null) {
} else if (entries.Count == 0) {

История изменений пуста. Значимые изменения (время, ссылка, название, участники) будут отображаться здесь.

} else {
@foreach (var entry in entries) { }
Время Актор Тип изменения Было Стало
@entry.ChangedAt.ToString("dd.MM.yyyy HH:mm") UTC @entry.ActorName (@entry.ActorExternalUserId) @GetChangeTypeLabel(entry.ChangeType) @(entry.OldValue ?? "—") @(entry.NewValue ?? "—")
}
@code { [Parameter] public Guid SessionId { get; set; } private List? entries; private string? sessionTitle; private Guid? groupId; protected override async Task OnInitializedAsync() { var authState = await AuthStateProvider.GetAuthenticationStateAsync(); if (!authState.User.TryGetPlatformIdentity(out var platform, out var externalUserId)) { Navigation.NavigateTo("/access-denied"); return; } var session = await SessionService.GetSessionForCurrentUserAsync(SessionId); if (session is null) { Navigation.NavigateTo("/access-denied"); return; } sessionTitle = session.Title; groupId = session.GroupId; entries = await SessionService.GetSessionHistoryForCurrentUserAsync(SessionId); } private string GetChangeTypeLabel(string changeType) => changeType switch { "Title" => "Название", "Time" => "Время", "Link" => "Ссылка", "MaxPlayers" => "Лимит мест", "Status" => "Статус", "WaitlistPromote" => "Продвижение из листа ожидания", "PlayerRemoved" => "Исключение игрока", "BatchRescheduled" => "Перенос батча", "Cancelled" => "Отмена", _ => changeType }; private string GetBadgeClass(string changeType) => changeType switch { "Cancelled" or "PlayerRemoved" => "status-danger", "WaitlistPromote" => "status-success", "BatchRescheduled" or "Time" => "status-warning", _ => "status-info" }; }