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 System;
using Data.Models;
using Data.Models.Client; using Data.Models.Client;
namespace SharedLibraryCore.Dtos namespace SharedLibraryCore.Dtos
@ -10,6 +11,7 @@ namespace SharedLibraryCore.Dtos
public int LinkId { get; set; } public int LinkId { get; set; }
public EFClient.Permission Level { get; set; } public EFClient.Permission Level { get; set; }
public DateTime LastConnection { get; set; } public DateTime LastConnection { get; set; }
public Reference.Game Game { get; set; }
public bool IsMasked { get; set; } public bool IsMasked { get; set; }
} }
} }

View File

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

View File

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

View File

@ -88,6 +88,7 @@ namespace WebfrontCore.Controllers
var clientDto = new PlayerInfo var clientDto = new PlayerInfo
{ {
Name = client.Name, Name = client.Name,
Game = client.GameName ?? Reference.Game.UKN,
Level = displayLevel, Level = displayLevel,
LevelInt = displayLevelInt, LevelInt = displayLevelInt,
ClientId = client.ClientId, ClientId = client.ClientId,
@ -181,7 +182,8 @@ namespace WebfrontCore.Controllers
Name = admin.Name, Name = admin.Name,
ClientId = admin.ClientId, ClientId = admin.ClientId,
LastConnection = admin.LastConnection, 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) @foreach (var key in Model.Keys)
{ {
<table class="table mb-20"> <table class="table mb-20" style="table-layout:fixed;">
<thead> <thead>
<tr class="level-bgcolor-@((int)key)"> <tr class="level-bgcolor-@((int)key)">
<th class="text-light">@key.ToLocalizedLevelName()</th> <th class="text-light">@key.ToLocalizedLevelName()</th>
<th>Game</th>
<th class="text-right font-weight-bold">Last Connected</th> <th class="text-right font-weight-bold">Last Connected</th>
</tr> </tr>
</thead> </thead>
@ -33,6 +34,9 @@
<color-code value="@client.Name"></color-code> <color-code value="@client.Name"></color-code>
</a> </a>
</td> </td>
<td>
<div class="badge">@ViewBag.Localization[$"GAME_{client.Game}"]</div>
</td>
<td class="text-right"> <td class="text-right">
@client.LastConnection.HumanizeForCurrentCulture() @client.LastConnection.HumanizeForCurrentCulture()
</td> </td>

View File

@ -58,7 +58,8 @@
</has-permission> </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"> <div id="profile_wrapper" class="mb-10 mt-10">
@ -200,7 +201,7 @@
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<hr class="mr-5 ml-5"/> <hr class="mr-5 ml-5"/>
<!-- meta info block --> <!-- meta info block -->
@ -299,7 +300,7 @@
EntityId = Model.ClientId EntityId = Model.ClientId
}); });
} }
if (Model.LevelInt < (int)ViewBag.User.Level && Model.Online) if (Model.LevelInt < (int)ViewBag.User.Level && Model.Online)
{ {
menuItems.Items.Add(new SideContextMenuItem menuItems.Items.Add(new SideContextMenuItem