IW4M-Admin/WebfrontCore/Views/Home/Index.cshtml

48 lines
2.2 KiB
Plaintext

@model SharedLibraryCore.Dtos.IW4MAdminInfo
@{
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
string formatTranslation(string translationKey, params object[] values)
{
var split = loc[translationKey].Split("::");
return split.Count() == 2 ? $"<span class='font-weight-bold text-primary'>{SharedLibraryCore.Utilities.FormatExt(split[0], values)}</span><span>{split[1]}</span>" : translationKey;
}
}
<div class="row mb-4 border-bottom border-top pt-3 pb-3 bg-dark">
<div class="col-xl-3 col-12">
<div class="text-muted text-center text-xl-left">@Html.Raw(formatTranslation("WEBFRONT_HOME_CLIENTS_ONLINE", Model.TotalOccupiedClientSlots, Model.TotalAvailableClientSlots))</div>
</div>
<div class="col-xl-3 col-12">
<div class="text-muted text-center text-xl-left">@Html.Raw(formatTranslation("WEBFRONT_HOME_MAX_CONCURRENT_CLIENTS", Model.MaxConcurrentClients.ToString("#,##0")))</div>
</div>
<div class="col-xl-3 col-12">
<div class="text-muted text-center">@Html.Raw(formatTranslation("WEBFRONT_HOME_RECENT_CLIENTS", Model.RecentClientCount.ToString("#,##0")))</div>
</div>
<div class="col-xl-3 col-12">
<div class="text-muted text-center text-xl-right">@Html.Raw(formatTranslation("WEBFRONT_HOME_TOTAL_CLIENTS", Model.TotalClientCount.ToString("#,##0")))</div>
</div>
</div>
@if (Model.ActiveServerGames.Length > 1)
{
<ul class="nav nav-tabs border-top border-bottom nav-fill row mb-4" role="tablist">
<li class="nav-item">
<a class="nav-link @(Model.Game.HasValue ? "" : "active")" href="/" role="tab" aria-selected="true">@loc["GAME_ALL"]</a>
</li>
@foreach (var gameName in Model.ActiveServerGames)
{
<li class="nav-item">
<a asp-action="Index" asp-controller="Home" asp-route-game="@gameName" class="nav-link @(Model.Game == gameName ? "active" : "")" role="tab" aria-selected="false">@loc[$"GAME_{gameName}"]</a>
</li>
}
</ul>
}
@await Component.InvokeAsync("ServerList", Model.Game)
@section scripts {
<environment include="Development">
<script type="text/javascript" src="~/js/server.js" defer="defer"></script>
</environment>
}