remove whitespace on alias display and client name search

This commit is contained in:
RaidMax 2021-03-31 11:20:32 -05:00
parent c84e374274
commit 21087d6c25
2 changed files with 15 additions and 10 deletions

View File

@ -547,7 +547,8 @@ namespace SharedLibraryCore.Services
public async Task<IList<PlayerInfo>> FindClientsByIdentifier(string identifier) public async Task<IList<PlayerInfo>> FindClientsByIdentifier(string identifier)
{ {
if (identifier?.Length < 3) var trimmedIdentifier = identifier?.Trim();
if (trimmedIdentifier?.Length < 3)
{ {
return new List<PlayerInfo>(); return new List<PlayerInfo>();
} }
@ -556,11 +557,11 @@ namespace SharedLibraryCore.Services
long? networkId = null; long? networkId = null;
try try
{ {
networkId = identifier.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber); networkId = trimmedIdentifier.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber);
} }
catch { } catch { }
int? ipAddress = identifier.ConvertToIP(); int? ipAddress = trimmedIdentifier.ConvertToIP();
IQueryable<EFAlias> iqLinkIds = context.Aliases.Where(_alias => _alias.Active); IQueryable<EFAlias> iqLinkIds = context.Aliases.Where(_alias => _alias.Active);
@ -573,7 +574,7 @@ namespace SharedLibraryCore.Services
// want to find them by name (wildcard) // want to find them by name (wildcard)
else else
{ {
iqLinkIds = iqLinkIds.Where(_alias => EF.Functions.Like((_alias.SearchableName ?? _alias.Name.ToLower()), $"%{identifier.ToLower()}%")); iqLinkIds = iqLinkIds.Where(_alias => EF.Functions.Like((_alias.SearchableName ?? _alias.Name.ToLower()), $"%{trimmedIdentifier.ToLower()}%"));
} }
var linkIds = await iqLinkIds var linkIds = await iqLinkIds

View File

@ -38,18 +38,22 @@
<div id="profile_aliases" class="text-muted pt-0 pt-lg-2 pb-2"> <div id="profile_aliases" class="text-muted pt-0 pt-lg-2 pb-2">
@foreach (var linked in Model.LinkedAccounts) @foreach (var linked in Model.LinkedAccounts)
{ {
@Html.ActionLink(linked.Value.ToString("X"), "ProfileAsync", "Client", new {id = linked.Key}, new {@class = "link-inverse"})<br/> <div>
@Html.ActionLink(linked.Value.ToString("X"), "ProfileAsync", "Client", new {id = linked.Key}, new {@class = "link-inverse"})
</div>
} }
@foreach (var alias in Model.Aliases) @foreach (var alias in Model.Aliases)
{ {
<color-code value="@alias" allow="@ViewBag.EnableColorCodes"></color-code> <div>
<br/> <color-code value="@alias" allow="@ViewBag.EnableColorCodes"></color-code>
</div>
} }
@foreach (string ip in Model.IPs) @foreach (var ip in Model.IPs)
{ {
<a class="ip-locate-link" href="#" data-ip="@ip">@ip</a> <div>
<br/> <a class="ip-locate-link" href="#" data-ip="@ip">@ip</a>
</div>
} }
</div> </div>
} }