mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
implement custom tag (descriptor) feature
allow override of level names through configuration few small fixes/improvements
This commit is contained in:
@ -88,8 +88,6 @@ namespace WebfrontCore.Controllers.API
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
HttpContext.Request.Cookies.TryGetValue(".AspNetCore.Cookies", out var cookie);
|
||||
|
||||
if (Authorized)
|
||||
{
|
||||
return Ok();
|
||||
|
@ -439,7 +439,7 @@ namespace WebfrontCore.Controllers
|
||||
|
||||
private Dictionary<string, string> GetPresetPenaltyReasons() => _appConfig.PresetPenaltyReasons.Values
|
||||
.Concat(_appConfig.GlobalRules)
|
||||
.Concat(_appConfig.Servers.SelectMany(server => server.Rules))
|
||||
.Concat(_appConfig.Servers.SelectMany(server => server.Rules ?? new string[0]))
|
||||
.Distinct()
|
||||
.Select((value, index) => new
|
||||
{
|
||||
|
@ -36,6 +36,11 @@ namespace WebfrontCore.Controllers
|
||||
|
||||
var activePenalties = (await Manager.GetPenaltyService().GetActivePenaltiesAsync(client.AliasLinkId, client.IPAddress));
|
||||
|
||||
var tag = await _metaService.GetPersistentMeta(EFMeta.ClientTag, client);
|
||||
if (tag?.LinkedMeta != null)
|
||||
{
|
||||
client.SetAdditionalProperty(EFMeta.ClientTag, tag.LinkedMeta.Value);
|
||||
}
|
||||
|
||||
int displayLevelInt = (int)client.Level;
|
||||
string displayLevel = client.Level.ToLocalizedLevelName();
|
||||
@ -46,6 +51,8 @@ namespace WebfrontCore.Controllers
|
||||
displayLevel = Permission.User.ToLocalizedLevelName();
|
||||
}
|
||||
|
||||
displayLevel = string.IsNullOrEmpty(client.Tag) ? displayLevel : $"{displayLevel} ({client.Tag})";
|
||||
|
||||
var clientDto = new PlayerInfo()
|
||||
{
|
||||
Name = client.Name,
|
||||
|
@ -29,7 +29,8 @@ namespace WebfrontCore.ViewComponents
|
||||
Name = p.Name,
|
||||
ClientId = p.ClientId,
|
||||
Level = p.Level.ToLocalizedLevelName(),
|
||||
LevelInt = (int)p.Level
|
||||
LevelInt = (int)p.Level,
|
||||
Tag = p.Tag
|
||||
}).ToList(),
|
||||
ChatHistory = s.ChatHistory.ToList(),
|
||||
Online = !s.Throttled,
|
||||
|
@ -7,7 +7,7 @@
|
||||
foreach (var key in Model.Keys)
|
||||
{
|
||||
<div class="col-12 bg-primary pt-2 pb-2">
|
||||
@key.ToString()
|
||||
@Utilities.ToLocalizedLevelName(key)
|
||||
</div>
|
||||
|
||||
<div class="col-12 bg-dark pt-2 pb-2">
|
||||
|
@ -45,57 +45,48 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="row" style="overflow-wrap: anywhere">
|
||||
<div class="col-6 text-left text-md-right">
|
||||
@{
|
||||
for (int i = 0; i < half; i++)
|
||||
<div class="row">
|
||||
<div class="text-left w-50" >
|
||||
@for (var i = 0; i < half; i++)
|
||||
{
|
||||
if (i > Model.Players.Count - 1)
|
||||
{
|
||||
if (i > Model.Players.Count - 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
||||
<div class="d-inline-flex">
|
||||
@if (ViewBag.Authorized)
|
||||
{
|
||||
<div class="oi oi-circle-x ml-0 mr-1 profile-action action-kick-button d-inline d-md-none" data-action="kick" data-action-id="@Model.Players[i].ClientId" aria-hidden="true"></div>
|
||||
}
|
||||
//Model.Players[i].Name = string.Join("", "DankMememachine12".Take(new Random().Next(14, 17)));
|
||||
|
||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass">
|
||||
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||
</a>
|
||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
||||
|
||||
@if (ViewBag.Authorized)
|
||||
{
|
||||
<div class="oi oi-circle-x ml-1 profile-action action-kick-button d-none d-md-inline" data-action="kick" data-action-id="@Model.Players[i].ClientId" aria-hidden="true"></div>
|
||||
}
|
||||
</div>
|
||||
<br />
|
||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass" style="overflow-wrap: break-word;">
|
||||
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||
</a>
|
||||
|
||||
@if (ViewBag.Authorized)
|
||||
{
|
||||
<div class="oi oi-circle-x ml-1 profile-action action-kick-button" data-action="kick" data-action-id="@Model.Players[i].ClientId" aria-hidden="true"></div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="col-6 text-right w-50">
|
||||
@{
|
||||
for (int i = half; i < Math.Min(Model.ClientCount, Model.Players.Count); i++)
|
||||
<div class="text-right w-50">
|
||||
@for (var i = half; i < Math.Min(Model.ClientCount, Model.Players.Count); i++)
|
||||
{
|
||||
if (i > Model.Players.Count - 1)
|
||||
{
|
||||
if (i > Model.Players.Count - 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
||||
//Model.Players[i].Name = string.Join("", "DankMememachine12".Take(new Random().Next(14, 17)));
|
||||
|
||||
<div>
|
||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass">
|
||||
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||
</a>
|
||||
@if (ViewBag.Authorized)
|
||||
{
|
||||
<span class="oi oi-circle-x ml-1 profile-action align-baseline action-kick-button flex-column" data-action="kick" data-action-id="@Model.Players[i].ClientId" aria-hidden="true"></span>
|
||||
}
|
||||
<br />
|
||||
</div>
|
||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
||||
|
||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass" style="overflow-wrap: break-word;">
|
||||
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||
</a>
|
||||
|
||||
@if (ViewBag.Authorized)
|
||||
{
|
||||
<div class="oi oi-circle-x ml-1 profile-action action-kick-button" data-action="kick" data-action-id="@Model.Players[i].ClientId" aria-hidden="true"></div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user