add game to player profile and admins page

This commit is contained in:
RaidMax 2022-06-07 21:58:32 -05:00
parent ab494a22cb
commit cf2a00e5b3
6 changed files with 18 additions and 6 deletions

View File

@ -1,4 +1,5 @@
using System;
using Data.Models;
using Data.Models.Client;
namespace SharedLibraryCore.Dtos
@ -10,6 +11,7 @@ namespace SharedLibraryCore.Dtos
public int LinkId { get; set; }
public EFClient.Permission Level { get; set; }
public DateTime LastConnection { get; set; }
public Reference.Game Game { get; set; }
public bool IsMasked { get; set; }
}
}

View File

@ -9,6 +9,7 @@ namespace SharedLibraryCore.Dtos
public class PlayerInfo
{
public string Name { get; set; }
public Reference.Game Game { get; set; }
public int ClientId { get; set; }
public string Level { get; set; }
public string Tag { get; set; }

View File

@ -178,6 +178,7 @@ namespace SharedLibraryCore.Services
.Select(_client => new EFClient
{
ClientId = _client.ClientId,
GameName = _client.GameName,
AliasLinkId = _client.AliasLinkId,
Level = _client.Level,
Connections = _client.Connections,
@ -789,7 +790,8 @@ namespace SharedLibraryCore.Services
PasswordSalt = client.PasswordSalt,
NetworkId = client.NetworkId,
LastConnection = client.LastConnection,
Masked = client.Masked
Masked = client.Masked,
GameName = client.GameName
};
return await iqClients.ToListAsync();

View File

@ -88,6 +88,7 @@ namespace WebfrontCore.Controllers
var clientDto = new PlayerInfo
{
Name = client.Name,
Game = client.GameName ?? Reference.Game.UKN,
Level = displayLevel,
LevelInt = displayLevelInt,
ClientId = client.ClientId,
@ -181,7 +182,8 @@ namespace WebfrontCore.Controllers
Name = admin.Name,
ClientId = admin.ClientId,
LastConnection = admin.LastConnection,
IsMasked = admin.Masked
IsMasked = admin.Masked,
Game = admin.GameName ?? Reference.Game.UKN
});
}

View File

@ -5,10 +5,11 @@
@foreach (var key in Model.Keys)
{
<table class="table mb-20">
<table class="table mb-20" style="table-layout:fixed;">
<thead>
<tr class="level-bgcolor-@((int)key)">
<th class="text-light">@key.ToLocalizedLevelName()</th>
<th>Game</th>
<th class="text-right font-weight-bold">Last Connected</th>
</tr>
</thead>
@ -33,6 +34,9 @@
<color-code value="@client.Name"></color-code>
</a>
</td>
<td>
<div class="badge">@ViewBag.Localization[$"GAME_{client.Game}"]</div>
</td>
<td class="text-right">
@client.LastConnection.HumanizeForCurrentCulture()
</td>

View File

@ -58,7 +58,8 @@
</has-permission>
}
<h2 class="content-title mb-10">Player Profile</h2>
<h2 class="content-title mb-0">Player Profile</h2>
<div class="font-size-12 text-muted">@ViewBag.Localization[$"GAME_{Model.Game}"]</div>
<div id="profile_wrapper" class="mb-10 mt-10">