1
0
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:
RaidMax
2022-04-19 18:43:58 -05:00
parent 7b78e0803a
commit d5b4c60e5a
105 changed files with 2981 additions and 2545 deletions

View File

@ -16,22 +16,16 @@ namespace WebfrontCore.ViewComponents
_config = config;
}
public async Task<IViewComponentResult> InvokeAsync(int count, int offset, long? serverId = null)
public async Task<IViewComponentResult> InvokeAsync(int count, int offset, string serverEndpoint = null)
{
if (serverId == 0)
{
serverId = null;
}
var server = Plugin.ServerManager.GetServers().FirstOrDefault(_server => _server.EndPoint == serverId);
if (server != null)
{
serverId = StatManager.GetIdForServer(server);
}
var server = Plugin.ServerManager.GetServers()
.FirstOrDefault(server => server.ToString() == serverEndpoint);
var serverId = server is null ? (long?)null : StatManager.GetIdForServer(server);
ViewBag.UseNewStats = _config?.EnableAdvancedMetrics ?? true;
ViewBag.SelectedServerName = server?.Hostname;
return View("~/Views/Client/Statistics/Components/TopPlayers/_List.cshtml",
ViewBag.UseNewStats
? await Plugin.Manager.GetNewTopStats(offset, count, serverId)