From db5a08b176d1ce59a36bebd834508ee178e5a419 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 21 Jun 2024 14:33:13 +0200 Subject: [PATCH] Add server column to connections table. --- SS14.Admin/Pages/Connections/Index.cshtml.cs | 11 +++++++---- SS14.Admin/Pages/Tables/ConnectionsTable.cshtml | 6 ++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/SS14.Admin/Pages/Connections/Index.cshtml.cs b/SS14.Admin/Pages/Connections/Index.cshtml.cs index 2998ae8..f4c8e94 100644 --- a/SS14.Admin/Pages/Connections/Index.cshtml.cs +++ b/SS14.Admin/Pages/Connections/Index.cshtml.cs @@ -1,6 +1,7 @@ using Content.Server.Database; using JetBrains.Annotations; using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.EntityFrameworkCore; using SS14.Admin.Helpers; namespace SS14.Admin.Pages.Connections @@ -99,10 +100,12 @@ public static async Task LoadSortConnectionsTableData( string? sort, Dictionary allRouteData) { - var logs = query.LeftJoin( - dbContext.Player, - c => c.UserId, p => p.UserId, - (c, p) => new { c, HitCount = c.BanHits.Count, Player = p }); + var logs = query + .Include(c => c.Server) + .LeftJoin( + dbContext.Player, + c => c.UserId, p => p.UserId, + (c, p) => new { c, HitCount = c.BanHits.Count, Player = p }); var sortState = Helpers.SortState.Build(logs); diff --git a/SS14.Admin/Pages/Tables/ConnectionsTable.cshtml b/SS14.Admin/Pages/Tables/ConnectionsTable.cshtml index 9a93211..012e20f 100644 --- a/SS14.Admin/Pages/Tables/ConnectionsTable.cshtml +++ b/SS14.Admin/Pages/Tables/ConnectionsTable.cshtml @@ -12,6 +12,9 @@ + + Server + @@ -64,6 +67,9 @@ break; } + + @log.Server.Name + @if (banHits != 0) {