ui tweaks/improvements including recent players and ip info lookup
This commit is contained in:
@ -1,52 +1,33 @@
|
||||
@model IEnumerable<SharedLibraryCore.Dtos.PlayerInfo>
|
||||
@{
|
||||
Layout = null;
|
||||
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
|
||||
}
|
||||
|
||||
|
||||
@*<table class="table table-striped">
|
||||
<thead>
|
||||
<tr class="bg-primary pt-2 pb-2">
|
||||
<th scope="col">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_CONFIGURATION_SERVER_IP"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_PROFILE_LOOKUP_LOCATION"]</th>
|
||||
<th scope="col" class="text-right">@loc["WEBFRONT_SEARCH_LAST_CONNECTED"]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@foreach (var client in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="w-25">
|
||||
<a asp-controller="Client" asp-action="Profile" asp-route-id="@client.ClientId" class="link-inverse">@client.Name</a>
|
||||
</td>
|
||||
<td class="w-25">
|
||||
@client.IPAddress
|
||||
</td>
|
||||
<td>
|
||||
<div class="client-location-flag" data-ip="@client.IPAddress" />
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@client.LastConnectionText
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
}
|
||||
</table>*@
|
||||
<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)
|
||||
{
|
||||
<div class="p-2 mb-3 border-bottom" style="background-color: #222;">
|
||||
<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>
|
||||
<div class="client-location-flag align-self-center" data-ip="@client.IPAddress"></div>
|
||||
@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>
|
||||
<div class="d-flex flex-row">
|
||||
<div class="align-self-center mr-auto">@client.IPAddress</div>
|
||||
<div class="align-self-center">@client.LastConnectionText</div>
|
||||
<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>
|
||||
}
|
||||
|
39
WebfrontCore/Views/Shared/Partials/_Reports.cshtml
Normal file
39
WebfrontCore/Views/Shared/Partials/_Reports.cshtml
Normal file
@ -0,0 +1,39 @@
|
||||
@using Data.Models
|
||||
@using SharedLibraryCore.Dtos.Meta.Responses
|
||||
@model IEnumerable<SharedLibraryCore.Dtos.ServerInfo>
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<div class="content-title">Recent Reports</div>
|
||||
<div class="text-muted">Last 24 hours</div>
|
||||
|
||||
@foreach (var server in Model)
|
||||
{
|
||||
<div class="rounded bg-very-dark-dm bg-light-ex-lm mt-10 mb-10 p-10">
|
||||
<h5 class="mt-0 text-truncate">
|
||||
<color-code value="@server.Name"></color-code>
|
||||
</h5>
|
||||
@foreach (var report in server.Reports.OrderByDescending(report => report.ReportedOn))
|
||||
{
|
||||
var penalty = new ReceivedPenaltyResponse
|
||||
{
|
||||
OffenderName = report.Target.Name,
|
||||
OffenderClientId = report.Target.ClientId,
|
||||
PunisherName = report.Origin.Name,
|
||||
PunisherClientId = report.Origin.ClientId,
|
||||
Offense = report.Reason,
|
||||
PenaltyType = EFPenalty.PenaltyType.Report,
|
||||
ClientId = report.Target.ClientId
|
||||
};
|
||||
<div class="font-weight-bold">@report.ReportedOn.HumanizeForCurrentCulture()</div>
|
||||
<div class="font-size-12">
|
||||
<a asp-action="Profile" asp-controller="Client" asp-route-id="@report.Target.ClientId">
|
||||
<color-code value="@report.Target.Name"></color-code>
|
||||
</a>
|
||||
<partial name="~/Views/Client/Profile/Meta/_ReceivedPenaltyResponse.cshtml" for="@penalty"/>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
}
|
||||
</div>
|
||||
}
|
@ -23,30 +23,30 @@
|
||||
@if (ViewBag.Configuration.WebfrontPrimaryColor is not null)
|
||||
{
|
||||
<style>
|
||||
:root {
|
||||
--blue-color: @ViewBag.Configuration.WebfrontPrimaryColor;
|
||||
}
|
||||
</style>
|
||||
:root {
|
||||
--blue-color: @ViewBag.Configuration.WebfrontPrimaryColor;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@if (ViewBag.Configuration.WebfrontSecondaryColor is not null)
|
||||
{
|
||||
<style>
|
||||
:root {
|
||||
--yellow-color: @ViewBag.Configuration.WebfrontSecondaryColor;
|
||||
}
|
||||
</style>
|
||||
:root {
|
||||
--yellow-color: @ViewBag.Configuration.WebfrontSecondaryColor;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@await RenderSectionAsync("styles", false)
|
||||
</head>
|
||||
<body class="dark-mode with-custom-webkit-scrollbars with-custom-css-scrollbars" data-set-preferred-mode-onload="true">
|
||||
|
||||
<!-- Action Modal -->
|
||||
<!-- action modal -->
|
||||
<div class="modal" id="actionModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div id="modalLoadingBar" class="progress-bar position-absolute flex-fill position-fixed z-30" style="display:none">
|
||||
<div id="modalLoadingBar" class="modal-loading-bar progress-bar position-absolute flex-fill position-fixed z-30" style="display:none">
|
||||
<div class="progress-bar-value"></div>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content p-10">
|
||||
<div class="modal-content">
|
||||
<a href="#" class="btn close" role="button" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
@ -59,6 +59,27 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- context modal -->
|
||||
<div class="modal" id="contextModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-loading-bar progress-bar position-absolute flex-fill position-fixed z-30" style="display:none">
|
||||
<div class="progress-bar-value"></div>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content p-10">
|
||||
<a href="#" class="btn close" role="button" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</a>
|
||||
<div id="contextModalContent">
|
||||
<div class="modal-title"></div>
|
||||
<hr/>
|
||||
<div class="modal-body font-size-12"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-wrapper with-navbar with-sidebar" data-sidebar-type="overlayed-sm-and-down">
|
||||
<!-- toast notifications -->
|
||||
<div class="sticky-alerts"></div>
|
||||
@ -88,47 +109,36 @@
|
||||
</has-permission>
|
||||
|
||||
<has-permission entity="AdminMenu" required-permission="Read">
|
||||
<div class="badge-group ml-10" role="group">
|
||||
<span class="badge badge-danger">@(ViewBag.ReportCount ?? "-")</span>
|
||||
<span class="badge bg-dark-dm bg-light-lm">Reports</span>
|
||||
</div>
|
||||
<a href="#actionModal" class="profile-action no-decoration" data-action="RecentReports" data-toggle="tooltip" data-title="View recent reports" data-placement="bottom">
|
||||
<div class="badge-group ml-10" role="group">
|
||||
<span class="badge badge-danger">@(ViewBag.ReportCount ?? "-")</span>
|
||||
<span class="badge bg-dark-dm bg-light-lm">Reports</span>
|
||||
</div>
|
||||
</a>
|
||||
</has-permission>
|
||||
</div>
|
||||
|
||||
<div class="d-flex d-lg-none ml-auto">
|
||||
<a href="#contextMenuModal">
|
||||
<button class="btn" type="button">
|
||||
<i class="oi oi-ellipses"></i>
|
||||
</button>
|
||||
</a>
|
||||
<div class="d-flex ml-auto">
|
||||
<div class="btn btn-action mr-10 ml-10" onclick="halfmoon.toggleDarkMode()" data-toggle="tooltip" data-title="Toggle display mode" data-placement="bottom">
|
||||
<i class="oi oi-moon"></i>
|
||||
</div>
|
||||
<div class="d-none d-md-block ">
|
||||
|
||||
<partial name="_SearchResourceForm"/>
|
||||
</div>
|
||||
<div class="d-flex d-lg-none">
|
||||
<a href="#contextMenuModal">
|
||||
<button class="btn" type="button">
|
||||
<i class="oi oi-ellipses"></i>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="d-none d-md-flex ml-auto">
|
||||
<div class="btn oi btn-square btn-action mr-10" data-glyph="moon" onclick="halfmoon.toggleDarkMode()" title="Toggle display mode"></div>
|
||||
</div>*@
|
||||
|
||||
<div class="d-none d-lg-block ml-auto">
|
||||
<partial name="_SearchResourceForm"/>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<partial name="_LeftNavBar"/>
|
||||
|
||||
<!-- Main Modal -->
|
||||
<!--<div class="modal fade" id="mainModal" tabindex="-1" role="dialog" aria-labelledby="mainModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="mainModalLabel"></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true" class="text-danger">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<!-- End Main Modal -->
|
||||
<div id="target_id">
|
||||
@await RenderSectionAsync("targetid", required: false)
|
||||
|
@ -23,10 +23,12 @@
|
||||
<span class="name">@ViewBag.Localization["WEBFRONT_NAV_ABOUT"]</span>
|
||||
</a>
|
||||
<!-- penalties -->
|
||||
<a asp-controller="Penalty" asp-action="List" class="sidebar-link">
|
||||
<i class="oi oi-lock-locked mr-5"></i>
|
||||
<span class="name">@ViewBag.Localization["WEBFRONT_NAV_PENALTIES"]</span>
|
||||
</a>
|
||||
<has-permission entity="Penalty" required-permission="Read">
|
||||
<a asp-controller="Penalty" asp-action="List" class="sidebar-link">
|
||||
<i class="oi oi-lock-locked mr-5"></i>
|
||||
<span class="name">@ViewBag.Localization["WEBFRONT_NAV_PENALTIES"]</span>
|
||||
</a>
|
||||
</has-permission>
|
||||
<!-- privileged -->
|
||||
<has-permission entity="PrivilegedClientsPage" required-permission="Read">
|
||||
<a asp-controller="Client" asp-action="Privileged" class="sidebar-link">
|
||||
@ -126,12 +128,12 @@
|
||||
<span class="name">@ViewBag.Localization["WEBFRONT_NAV_AUDIT_LOG"]</span>
|
||||
</a>
|
||||
</has-permission>
|
||||
@*<has-permission entity="RecentPlayersPage" required-permission="Read">
|
||||
<has-permission entity="RecentPlayersPage" required-permission="Read">
|
||||
<a class="sidebar-link profile-action" href="#actionModal" data-action="RecentClients" title="@ViewBag.Localization["WEBFRONT_ACTION_RECENT_CLIENTS"]">
|
||||
<i class="oi oi-timer mr-5"></i>
|
||||
<span class="name">@ViewBag.Localization["WEBFRONT_ACTION_RECENT_CLIENTS"]</span>
|
||||
</a>
|
||||
</has-permission>*@
|
||||
</has-permission>
|
||||
<a class="sidebar-link profile-action" href="#actionModal" data-action="GenerateLoginToken" title="@ViewBag.Localization["WEBFRONT_ACTION_TOKEN"]">
|
||||
<i class="oi oi-key mr-5"></i>
|
||||
<span class="name">@ViewBag.Localization["WEBFRONT_ACTION_TOKEN"]</span>
|
||||
|
Reference in New Issue
Block a user