remove whitespace on alias display and client name search
This commit is contained in:
parent
c84e374274
commit
21087d6c25
@ -547,7 +547,8 @@ namespace SharedLibraryCore.Services
|
||||
|
||||
public async Task<IList<PlayerInfo>> FindClientsByIdentifier(string identifier)
|
||||
{
|
||||
if (identifier?.Length < 3)
|
||||
var trimmedIdentifier = identifier?.Trim();
|
||||
if (trimmedIdentifier?.Length < 3)
|
||||
{
|
||||
return new List<PlayerInfo>();
|
||||
}
|
||||
@ -556,11 +557,11 @@ namespace SharedLibraryCore.Services
|
||||
long? networkId = null;
|
||||
try
|
||||
{
|
||||
networkId = identifier.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber);
|
||||
networkId = trimmedIdentifier.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber);
|
||||
}
|
||||
catch { }
|
||||
|
||||
int? ipAddress = identifier.ConvertToIP();
|
||||
int? ipAddress = trimmedIdentifier.ConvertToIP();
|
||||
|
||||
IQueryable<EFAlias> iqLinkIds = context.Aliases.Where(_alias => _alias.Active);
|
||||
|
||||
@ -573,7 +574,7 @@ namespace SharedLibraryCore.Services
|
||||
// want to find them by name (wildcard)
|
||||
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
|
||||
|
@ -38,18 +38,22 @@
|
||||
<div id="profile_aliases" class="text-muted pt-0 pt-lg-2 pb-2">
|
||||
@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)
|
||||
{
|
||||
<color-code value="@alias" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||
<br/>
|
||||
<div>
|
||||
<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>
|
||||
<br/>
|
||||
<div>
|
||||
<a class="ip-locate-link" href="#" data-ip="@ip">@ip</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user