1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

improve loading of recent clients

This commit is contained in:
RaidMax
2022-04-28 11:42:23 -05:00
parent d926901ffa
commit dc07e72fb3
11 changed files with 49 additions and 56 deletions

View File

@ -1,24 +0,0 @@
@model SharedLibraryCore.Dtos.PlayerInfo
<div class="bg-very-dark-dm bg-light-ex-lm p-15 rounded mb-10">
<div class="d-flex flex-row">
<a asp-controller="Client" asp-action="Profile" asp-route-id="@Model.ClientId" class="h4 mr-auto">
<color-code value="@Model.Name"></color-code>
</a>
@if (Model.GeoLocationInfo is not null)
{
@if (!string.IsNullOrEmpty(Model.GeoLocationInfo.CountryCode))
{
<div data-toggle="tooltip" data-title="@Model.GeoLocationInfo.Country">
<div class="rounded" style="width: 40px; height: 25.66px; background-repeat: no-repeat; background-position: center center; background-image: url('https://flagcdn.com/w40/@(Model.GeoLocationInfo.CountryCode.ToLower()).png')"></div>
</div>
}
}
</div>
<div class="d-flex flex-row">
<has-permission entity="ClientIPAddress" required-permission="Read">
<div class="align-self-center mr-auto">@Model.IPAddress</div>
</has-permission>
<div class="align-self-center text-muted font-size-12">@Model.LastConnection.HumanizeForCurrentCulture()</div>
</div>
</div>

View File

@ -3,28 +3,28 @@
Layout = null;
}
@if (ViewBag.First)
{
<div class="mb-15 text-center font-weight-lighter">New clients connected in the last <span class="text-primary">24</span> hours</div>
}
@foreach (var client in Model)
{
@if (ViewBag.First)
{
<div id="recentClientsContainer">
<partial name="~/Views/Shared/Components/Client/_RecentClient.cshtml" for="@client"/>
<div class="bg-very-dark-dm bg-light-ex-lm p-15 rounded mb-10">
<div class="d-flex flex-row">
<a asp-controller="Client" asp-action="Profile" asp-route-id="@client.ClientId" class="h4 mr-auto">
<color-code value="@client.Name"></color-code>
</a>
@if (client.GeoLocationInfo is not null)
{
@if (!string.IsNullOrEmpty(client.GeoLocationInfo.CountryCode))
{
<div data-toggle="tooltip" data-title="@client.GeoLocationInfo.Country">
<div class="rounded" style="width: 40px; height: 25.66px; background-repeat: no-repeat; background-position: center center; background-image: url('https://flagcdn.com/w40/@(client.GeoLocationInfo.CountryCode.ToLower()).png')"></div>
</div>
}
}
</div>
}
else
{
<partial name="~/Views/Shared/Components/Client/_RecentClient.cshtml" for="@client"/>
}
}
@if (ViewBag.First)
{
<i id="loaderLoad" class="loader-load-more oi oi-chevron-bottom text-center text-primary d-none d-lg-block mt-10"></i>
<script>initLoader('/Action/RecentClientsForm', '#recentClientsContainer', 20);</script>
<div class="d-flex flex-row">
<has-permission entity="ClientIPAddress" required-permission="Read">
<div class="align-self-center mr-auto">@client.IPAddress</div>
</has-permission>
<div class="align-self-center text-muted font-size-12">@client.LastConnection.HumanizeForCurrentCulture()</div>
</div>
</div>
}

View File

@ -0,0 +1,13 @@
@model IEnumerable<SharedLibraryCore.Dtos.PlayerInfo>
@{
Layout = null;
}
<div class="mb-15 text-center font-weight-lighter">New clients connected in the last <span class="text-primary">24</span> hours</div>
<div id="recentClientContainer">
<partial name="~/Views/Shared/Components/Client/_RecentClients.cshtml" for="@Model"/>
</div>
<i class="loader-load-more oi oi-chevron-bottom text-center text-primary w-full"></i>
<script>initLoader('/Action/RecentClientsForm', '#recentClientContainer', 20);</script>

View File

@ -163,6 +163,7 @@
<script type="text/javascript" src="~/lib/chart.js/dist/Chart.bundle.min.js"></script>
<script type="text/javascript" src="~/lib/halfmoon/js/halfmoon.js"></script>
<script type="text/javascript" src="~/js/action.js"></script>
<script type="text/javascript" src="~/js/loader.js"></script>
<script type="text/javascript" src="~/js/search.js"></script>
</environment>
<environment include="Production">