@using WebfrontCore.ViewModels @using Humanizer @model SharedLibraryCore.Dtos.IW4MAdminInfo @{ var loc = Utilities.CurrentLocalization.LocalizationIndex; string FormatTranslation(string translationKey, params object[] values) { var split = loc[translationKey].Split("::"); return split.Length == 2 ? $"{split[0].FormatExt(values)}{split[1]}" : translationKey; } }

@ViewBag.Localization["WEBFRONT_SERVERS_TITLE"]

@if (Model.Game.HasValue) { @loc[$"GAME_{Model.Game.Value}"] } else { @ViewBag.Localization["WEBFRONT_STATS_INDEX_ALL_SERVERS"] }
@Html.Raw(FormatTranslation("WEBFRONT_HOME_CLIENTS_ONLINE", Model.TotalOccupiedClientSlots, Model.TotalAvailableClientSlots))
@Html.Raw(FormatTranslation("WEBFRONT_HOME_MAX_CONCURRENT_CLIENTS", Model.MaxConcurrentClients.ToString("#,##0")))
@Html.Raw(FormatTranslation("WEBFRONT_HOME_RECENT_CLIENTS", Model.RecentClientCount.ToString("#,##0")))
@Html.Raw(FormatTranslation("WEBFRONT_HOME_TOTAL_CLIENTS", Model.TotalClientCount.ToString("#,##0")))
@await Component.InvokeAsync("ServerList", Model.Game)
@{ var menuItems = new SideContextMenuItems { MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_GAME"], Items = Model.ActiveServerGames.Select(game => new SideContextMenuItem { IsLink = true, Reference = Url.Action("Index", "Home", new { game }), Title = loc[$"GAME_{game}"], IsActive = game == Model.Game }).Prepend(new SideContextMenuItem { IsLink = true, Reference = Url.Action("Index", "Home"), Title = loc["GAME_ALL"], IsActive = !Model.Game.HasValue }).ToList() }; }
@section scripts { }