Skip to content

Commit

Permalink
Add server column to connections table.
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 committed Jun 21, 2024
1 parent 3939609 commit db5a08b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions SS14.Admin/Pages/Connections/Index.cshtml.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -99,10 +100,12 @@ public static async Task<ISortState> LoadSortConnectionsTableData(
string? sort,
Dictionary<string, string?> 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);

Expand Down
6 changes: 6 additions & 0 deletions SS14.Admin/Pages/Tables/ConnectionsTable.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<partial name="Tables/SortTabHeader" model="@(new SortTabHeaderModel(Model.SortState, "addr", "IP Address"))"/>
<partial name="Tables/SortTabHeader" model="@(new SortTabHeaderModel(Model.SortState, "hwid", "HWID"))"/>
<partial name="Tables/SortTabHeader" model="@(new SortTabHeaderModel(Model.SortState, "denied", "Status"))"/>
<th>
Server
</th>
<partial name="Tables/SortTabHeader" model="@(new SortTabHeaderModel(Model.SortState, "hits", "Bans Hit"))"/>
</tr>
</thead>
Expand Down Expand Up @@ -64,6 +67,9 @@
break;
}
</td>
<td>
@log.Server.Name
</td>
<td>
@if (banHits != 0)
{
Expand Down

0 comments on commit db5a08b

Please sign in to comment.