@page "/admin/players" @model Players.IndexModel @using DataServer.Data @{ ViewData["Title"] = "Players"; }

Players

Manage player accounts

Clear

@Model.TotalCount

Total Accounts

@Model.ActiveCount

Active

@Model.BannedCount

Banned

@Model.AdminCount

Admins

@foreach (var account in Model.Accounts) { var isBanned = account.IsBanned || (account.BannedUntil.HasValue && account.BannedUntil > DateTime.UtcNow); } @if (!Model.Accounts.Any()) { }
ID Username Email Role Status Created Actions
@account.Id @account.Username @(account.Email ?? "-") @{ var roleColor = account.Role switch { AccountRole.SuperAdmin => "bg-red-600", AccountRole.Admin => "bg-orange-600", AccountRole.Moderator => "bg-yellow-600", AccountRole.Vip => "bg-purple-600", _ => "bg-gray-600" }; } @account.Role @if (isBanned) { @if (account.BannedUntil.HasValue && account.BannedUntil > DateTime.UtcNow) { Until @account.BannedUntil.Value.ToString("MMM d") } else { Permanent } } else { Active } @account.CreatedAt.ToString("yyyy-MM-dd") Edit
No accounts found.
@if (Model.TotalPages > 1) {

Showing @((Model.CurrentPage - 1) * Model.PageSize + 1)-@Math.Min(Model.CurrentPage * Model.PageSize, Model.TotalCount) of @Model.TotalCount

@if (Model.CurrentPage > 1) { ← Prev } @Model.CurrentPage / @Model.TotalPages @if (Model.CurrentPage < Model.TotalPages) { Next → }
}
@if (!string.IsNullOrEmpty(Model.Message)) {
@Model.Message
}