@using WebfrontCore.QueryHelpers.Models @using Microsoft.AspNetCore.Mvc.TagHelpers @using WebfrontCore.Permissions @using Data.Models.Client @model WebfrontCore.QueryHelpers.Models.ClientResourceResponse @{ var loc = Utilities.CurrentLocalization.LocalizationIndex; var client = Model; var canSeeLevel = (ViewBag.PermissionsSet as IEnumerable).HasPermission(WebfrontEntity.ClientLevel, WebfrontPermission.Read); var canSeeIp = (ViewBag.PermissionsSet as IEnumerable).HasPermission(WebfrontEntity.ClientIPAddress, WebfrontPermission.Read); string FormatNameChange(ClientResourceResponse clientResponse) { return clientResponse.CurrentClientName.StripColors() != clientResponse.MatchedClientName?.StripColors() ? $"{clientResponse.CurrentClientName} [{clientResponse.MatchedClientName}{((clientResponse.MatchedClientIp is null && clientResponse.MatchedClientIp != clientResponse.CurrentClientIp) ? "" : $"/{FormatIpForPermission(clientResponse.MatchedClientIp)}")}]" : clientResponse.CurrentClientName; } string ClassForLevel(EFClient.Permission permission) => !canSeeLevel ? "level-color-user" : $"level-color-{permission.ToString().ToLower()}"; string FormatIpForPermission(int? ip) => canSeeIp && ip is not null ? ip.ConvertIPtoString() : "-"; } @FormatIpForPermission(client.CurrentClientIp)
@if (string.IsNullOrEmpty(client.ClientCountryCode)) {
Unknown
} else { @client.ClientCountryDisplayName }
@client.ClientCountryDisplayName
@(canSeeLevel ? client.ClientLevel : "-")
@Utilities.MakeAbbreviation(ViewBag.Localization["GAME_" + client.Game])
@client.LastConnection.HumanizeForCurrentCulture()
@loc["WEBFRONT_ADVANCED_SEARCH_CONTENT_TABLE_NAME"]
@loc["WEBFRONT_ADVANCED_SEARCH_CONTENT_TABLE_ALIAS"]
@loc["WEBFRONT_ADVANCED_SEARCH_CONTENT_TABLE_IP"]
@loc["WEBFRONT_ADVANCED_SEARCH_CONTENT_TABLE_COUNTRY"]
@loc["WEBFRONT_PROFILE_LEVEL"]
@loc["WEBFRONT_ADVANCED_SEARCH_LABEL_GAME"]
@loc["WEBFRONT_SEARCH_LAST_CONNECTED"]
@if (client.MatchedClientIp != client.CurrentClientIp && canSeeIp) { / @client.MatchedClientIp.ConvertIPtoString() }
@FormatIpForPermission(client.CurrentClientIp)
@if (string.IsNullOrEmpty(client.ClientCountryCode)) {
Unknown
} else {
@client.ClientCountryDisplayName
@client.ClientCountryDisplayName }
@(canSeeLevel ? client.ClientLevel : "-")
@Utilities.MakeAbbreviation(ViewBag.Localization["GAME_" + client.Game])
@client.LastConnection.HumanizeForCurrentCulture()