mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
huge commit for webfront facelift
This commit is contained in:
@ -1,74 +1,58 @@
|
||||
@model IEnumerable<(string, IEnumerable<SharedLibraryCore.Interfaces.IManagerCommand>)>
|
||||
@{
|
||||
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
|
||||
var loc = Utilities.CurrentLocalization.LocalizationIndex;
|
||||
}
|
||||
@foreach ((var pluginName, var commandList) in Model)
|
||||
{
|
||||
<h4 class="text-center pb-0 pb-xl-3 pt-3 pt-xl-0">@pluginName</h4>
|
||||
|
||||
<!-- desktop -->
|
||||
<table class="table table-striped border-bottom col-10 ml-auto mr-auto d-none d-lg-table mb-4 text-light">
|
||||
<thead>
|
||||
<tr class="bg-primary text-white">
|
||||
<th scope="col">@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</th>
|
||||
<div class="content mt-20">
|
||||
@foreach (var (pluginName, commandList) in Model)
|
||||
{
|
||||
<h2 class="content-title mb-lg-20 mt-20 ">@(pluginName == "Native" ? "Command List" : pluginName)</h2>
|
||||
|
||||
<table class="table rounded">
|
||||
<thead>
|
||||
<!-- desktop -->
|
||||
<tr class="bg-primary text-light d-none d-lg-table-row ">
|
||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</th>
|
||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</th>
|
||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</th>
|
||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</th>
|
||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</th>
|
||||
<th class="text-right">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var command in commandList)
|
||||
{
|
||||
<tr class="bg-dark">
|
||||
<th scope="row">@command.Name</th>
|
||||
<!-- desktop -->
|
||||
<tr class="d-none d-lg-table-row bg-dark-dm bg-light-lm">
|
||||
<td>@command.Name</td>
|
||||
<td>@command.Alias</td>
|
||||
<td>@command.Description</td>
|
||||
<td>@command.RequiresTarget</td>
|
||||
<td>@ViewBag.CommandPrefix@command.Syntax.Split(@ViewBag.CommandPrefix)[1]</td>
|
||||
<td>@command.Permission.ToLocalizedLevelName()</td>
|
||||
<td>@ViewBag.CommandPrefix@command.Syntax.Split(ViewBag.CommandPrefix)[1]</td>
|
||||
<td class="text-right level-color-@((int)command.Permission)">@command.Permission.ToLocalizedLevelName()</td>
|
||||
</tr>
|
||||
|
||||
<!-- mobile -->
|
||||
<tr class="d-table-row d-lg-none d-flex bg-dark-dm bg-light-lm">
|
||||
<td class="bg-primary text-right" style="min-width: 124px;">
|
||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</div>
|
||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</div>
|
||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</div>
|
||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</div>
|
||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</div>
|
||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="mt-5 mb-5">@command.Name</div>
|
||||
<div class="mt-5 mb-5">@command.Alias</div>
|
||||
<div class="mt-5 mb-5">@command.Description</div>
|
||||
<div class="mt-5 mb-5">@command.RequiresTarget</div>
|
||||
<div class="mt-5 mb-5">@ViewBag.CommandPrefix@command.Syntax.Split(ViewBag.CommandPrefix)[1]</div>
|
||||
<div class="mt-5 mb-5 @($"level-color-{(int)command.Permission}")">@command.Permission.ToLocalizedLevelName()</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- mobile -->
|
||||
<table class="table border-bottomb d-table d-lg-none">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var command in commandList)
|
||||
{
|
||||
<tr>
|
||||
<td scope="row" class="bg-primary">@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</td>
|
||||
<td class="bg-dark text-light">@command.Name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" class="bg-primary">@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</td>
|
||||
<td class="bg-dark text-light">@command.Alias</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" class="bg-primary">@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</td>
|
||||
<td class="bg-dark text-light">@command.Description</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" class="bg-primary">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</td>
|
||||
<td class="bg-dark text-light">@command.RequiresTarget</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" class="bg-primary">@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</td>
|
||||
<td class="bg-dark text-light">@ViewBag.CommandPrefix@command.Syntax.Split(@ViewBag.CommandPrefix)[1]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" class="bg-primary" style="border-bottom: #222 1px solid;">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</td>
|
||||
<td class="bg-dark border-bottom @($"level-color-{(int)command.Permission}")">@command.Permission.ToLocalizedLevelName()</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
|
@ -1,44 +1,57 @@
|
||||
@model SharedLibraryCore.Dtos.IW4MAdminInfo
|
||||
@{
|
||||
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
|
||||
string formatTranslation(string translationKey, params object[] values)
|
||||
@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.Count() == 2 ? $"<span class='font-weight-bold text-primary'>{SharedLibraryCore.Utilities.FormatExt(split[0], values)}</span><span>{split[1]}</span>" : translationKey;
|
||||
return split.Length == 2 ? $"<span class='font-weight-bold text-primary'>{split[0].FormatExt(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 moment-date" title="@Model.MaxConcurrentClientsTime">
|
||||
<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)
|
||||
<div class="content mt-20 row">
|
||||
<div class="col-12 col-lg-9 col-xl-10">
|
||||
<h2 class="content-title mb-0">Server Overview</h2>
|
||||
@if (Model.Game.HasValue)
|
||||
{
|
||||
<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>
|
||||
<span class="text-muted">@loc[$"GAME_{Model.Game.Value}"]</span>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
||||
@await Component.InvokeAsync("ServerList", Model.Game)
|
||||
else
|
||||
{
|
||||
<span class="text-muted">@ViewBag.Localization["WEBFRONT_STATS_INDEX_ALL_SERVERS"]</span>
|
||||
}
|
||||
<div class="card p-0 m-0">
|
||||
<div class="d-flex flex-column flex-md-row justify-content-md-between bg-dark-dm bg-light-lm p-10 mt-15 mb-15 rounded">
|
||||
<div class="align-self-center align-content-md-start">@Html.Raw(FormatTranslation("WEBFRONT_HOME_CLIENTS_ONLINE", Model.TotalOccupiedClientSlots, Model.TotalAvailableClientSlots))</div>
|
||||
<div class="align-self-center align-content-md-start" data-toggle="tooltip" data-title="@Model.MaxConcurrentClientsTime.HumanizeForCurrentCulture().Titleize()">@Html.Raw(FormatTranslation("WEBFRONT_HOME_MAX_CONCURRENT_CLIENTS", Model.MaxConcurrentClients.ToString("#,##0")))</div>
|
||||
<div class="align-self-center align-content-md-start">@Html.Raw(FormatTranslation("WEBFRONT_HOME_RECENT_CLIENTS", Model.RecentClientCount.ToString("#,##0")))</div>
|
||||
<div class="align-self-center align-content-md-start">@Html.Raw(FormatTranslation("WEBFRONT_HOME_TOTAL_CLIENTS", Model.TotalClientCount.ToString("#,##0")))</div>
|
||||
</div>
|
||||
</div>
|
||||
@await Component.InvokeAsync("ServerList", Model.Game)
|
||||
</div>
|
||||
|
||||
@{
|
||||
var menuItems = new SideContextMenuItems
|
||||
{
|
||||
MenuTitle = "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()
|
||||
};
|
||||
}
|
||||
<partial name="_SideContextMenu" for="@menuItems"></partial>
|
||||
</div>
|
||||
|
||||
@section scripts {
|
||||
<environment include="Development">
|
||||
|
Reference in New Issue
Block a user