add most recent players dropdown option to webfront
remove unneeded compiled bootstrap file
This commit is contained in:
parent
d301915273
commit
f42a66e756
1
.gitignore
vendored
1
.gitignore
vendored
@ -221,6 +221,7 @@ DEPLOY
|
|||||||
global.min.css
|
global.min.css
|
||||||
global.min.js
|
global.min.js
|
||||||
bootstrap-custom.min.css
|
bootstrap-custom.min.css
|
||||||
|
bootstrap-custom.css
|
||||||
**/Master/static
|
**/Master/static
|
||||||
**/Master/dev_env
|
**/Master/dev_env
|
||||||
/WebfrontCore/Views/Plugins/*
|
/WebfrontCore/Views/Plugins/*
|
||||||
|
@ -14,6 +14,7 @@ using SharedLibraryCore.Helpers;
|
|||||||
using SharedLibraryCore.Interfaces;
|
using SharedLibraryCore.Interfaces;
|
||||||
using SharedLibraryCore.Services;
|
using SharedLibraryCore.Services;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -59,6 +60,7 @@ namespace IW4MAdmin.Application
|
|||||||
private readonly MetaService _metaService;
|
private readonly MetaService _metaService;
|
||||||
private readonly TimeSpan _throttleTimeout = new TimeSpan(0, 1, 0);
|
private readonly TimeSpan _throttleTimeout = new TimeSpan(0, 1, 0);
|
||||||
private readonly CancellationTokenSource _tokenSource;
|
private readonly CancellationTokenSource _tokenSource;
|
||||||
|
private readonly Dictionary<string, Task<IList>> _operationLookup = new Dictionary<string, Task<IList>>();
|
||||||
|
|
||||||
private ApplicationManager()
|
private ApplicationManager()
|
||||||
{
|
{
|
||||||
@ -756,5 +758,16 @@ namespace IW4MAdmin.Application
|
|||||||
{
|
{
|
||||||
return new DynamicEventParser();
|
return new DynamicEventParser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<IList<T>> ExecuteSharedDatabaseOperation<T>(string operationName)
|
||||||
|
{
|
||||||
|
var result = await _operationLookup[operationName];
|
||||||
|
return (IList<T>)result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterSharedDatabaseOperation(Task<IList> operation, string operationName)
|
||||||
|
{
|
||||||
|
_operationLookup.Add(operationName, operation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StatsWeb", "Plugins\Web\Sta
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveRadar", "Plugins\LiveRadar\LiveRadar.csproj", "{00A1FED2-2254-4AF7-A5DB-2357FA7C88CD}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveRadar", "Plugins\LiveRadar\LiveRadar.csproj", "{00A1FED2-2254-4AF7-A5DB-2357FA7C88CD}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@ -5,6 +5,7 @@ using SharedLibraryCore.Configuration;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using SharedLibraryCore.Database.Models;
|
using SharedLibraryCore.Database.Models;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
namespace SharedLibraryCore.Interfaces
|
namespace SharedLibraryCore.Interfaces
|
||||||
{
|
{
|
||||||
@ -36,6 +37,15 @@ namespace SharedLibraryCore.Interfaces
|
|||||||
IPageList GetPageList();
|
IPageList GetPageList();
|
||||||
IList<IRConParser> AdditionalRConParsers { get; }
|
IList<IRConParser> AdditionalRConParsers { get; }
|
||||||
IList<IEventParser> AdditionalEventParsers { get; }
|
IList<IEventParser> AdditionalEventParsers { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// provides a method to execute database operations by name without exposing the
|
||||||
|
/// service level methods
|
||||||
|
/// todo: this could be made obsolete by creating a seperate service library with more concrete definitions
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="operationName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IList<T>> ExecuteSharedDatabaseOperation<T>(string operationName);
|
||||||
|
void RegisterSharedDatabaseOperation(Task<IList> operation, string operationName);
|
||||||
IRConParser GenerateDynamicRConParser();
|
IRConParser GenerateDynamicRConParser();
|
||||||
IEventParser GenerateDynamicEventParser();
|
IEventParser GenerateDynamicEventParser();
|
||||||
string Version { get;}
|
string Version { get;}
|
||||||
|
@ -109,7 +109,7 @@ namespace SharedLibraryCore.Services
|
|||||||
var aliasSql = iqAliases.ToSql();
|
var aliasSql = iqAliases.ToSql();
|
||||||
#endif
|
#endif
|
||||||
var aliases = await iqAliases.ToListAsync();
|
var aliases = await iqAliases.ToListAsync();
|
||||||
|
|
||||||
// see if they have a matching IP + Name but new NetworkId
|
// see if they have a matching IP + Name but new NetworkId
|
||||||
var existingExactAlias = aliases.FirstOrDefault(a => a.Name == name && a.IPAddress == ip);
|
var existingExactAlias = aliases.FirstOrDefault(a => a.Name == name && a.IPAddress == ip);
|
||||||
bool hasExactAliasMatch = existingExactAlias != null;
|
bool hasExactAliasMatch = existingExactAlias != null;
|
||||||
@ -531,6 +531,32 @@ namespace SharedLibraryCore.Services
|
|||||||
.CountAsync();
|
.CountAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gets the 10 most recently added clients to IW4MAdmin
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IList<PlayerInfo>> GetRecentClients()
|
||||||
|
{
|
||||||
|
using (var context = new DatabaseContext(true))
|
||||||
|
{
|
||||||
|
var iqClients = context.Clients
|
||||||
|
.Where(_client => _client.CurrentAlias.IPAddress != null)
|
||||||
|
.Select(_client => new PlayerInfo()
|
||||||
|
{
|
||||||
|
ClientId = _client.ClientId,
|
||||||
|
Name = _client.CurrentAlias.Name,
|
||||||
|
IPAddress = _client.CurrentAlias.IPAddress.ConvertIPtoString(),
|
||||||
|
LastConnection = _client.LastConnection
|
||||||
|
})
|
||||||
|
.OrderByDescending(_client => _client.ClientId)
|
||||||
|
.Take(10);
|
||||||
|
#if DEBUG
|
||||||
|
var sql = iqClients.ToSql();
|
||||||
|
#endif
|
||||||
|
return await iqClients.ToListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,5 +241,11 @@ namespace WebfrontCore.Controllers
|
|||||||
command = $"!say {message}"
|
command = $"!say {message}"
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<IActionResult> RecentClientsForm()
|
||||||
|
{
|
||||||
|
var clients = await Manager.GetClientService().GetRecentClients();
|
||||||
|
return View("~/Views/Shared/Components/Client/_RecentClients.cshtml", clients);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
@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="ProfileAsync" 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>*@
|
||||||
|
|
||||||
|
@foreach (var client in Model)
|
||||||
|
{
|
||||||
|
<div class="p-2 mb-3 border-bottom" style="background-color: #222;">
|
||||||
|
<div class="d-flex flex-row">
|
||||||
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId" class="h4 mr-auto">@client.Name</a>
|
||||||
|
<div class="client-location-flag align-self-center" data-ip="@client.IPAddress"></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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
@ -61,6 +61,7 @@
|
|||||||
{
|
{
|
||||||
<a asp-controller="Configuration" asp-action="Edit" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_EDIT_CONFIGURATION"]</a>
|
<a asp-controller="Configuration" asp-action="Edit" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_EDIT_CONFIGURATION"]</a>
|
||||||
}
|
}
|
||||||
|
<a class="dropdown-item bg-dark text-muted text-center text-lg-left profile-action" href="#" data-action="RecentClients" title="@loc["WEBFRONT_ACTION_RECENT_CLIENTS"]">@loc["WEBFRONT_ACTION_RECENT_CLIENTS"]</a>
|
||||||
<a class="dropdown-item bg-dark text-muted text-center text-lg-left profile-action" href="#" data-action="GenerateLoginToken" title="@loc["WEBFRONT_ACTION_TOKEN"]">@loc["WEBFRONT_ACTION_TOKEN"]</a>
|
<a class="dropdown-item bg-dark text-muted text-center text-lg-left profile-action" href="#" data-action="GenerateLoginToken" title="@loc["WEBFRONT_ACTION_TOKEN"]">@loc["WEBFRONT_ACTION_TOKEN"]</a>
|
||||||
<a asp-controller="Account" asp-action="LogoutAsync" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_LOGOUT"]</a>
|
<a asp-controller="Account" asp-action="LogoutAsync" class="dropdown-item bg-dark text-muted text-center text-lg-left">@loc["WEBFRONT_NAV_LOGOUT"]</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
<Content Remove="Views\Plugins\Stats\_MessageContext.cshtml" />
|
<Content Remove="Views\Plugins\Stats\_MessageContext.cshtml" />
|
||||||
<Content Remove="Views\Plugins\Stats\_PenaltyInfo.cshtml" />
|
<Content Remove="Views\Plugins\Stats\_PenaltyInfo.cshtml" />
|
||||||
<Content Remove="Views\Plugins\_ViewImports.cshtml" />
|
<Content Remove="Views\Plugins\_ViewImports.cshtml" />
|
||||||
|
<Content Remove="wwwroot\css\bootstrap-custom.css" />
|
||||||
|
<Content Remove="wwwroot\css\bootstrap-custom.min.css" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
6472
WebfrontCore/wwwroot/css/bootstrap-custom.css
vendored
6472
WebfrontCore/wwwroot/css/bootstrap-custom.css
vendored
File diff suppressed because it is too large
Load Diff
@ -289,3 +289,11 @@ form *, select {
|
|||||||
.hide {
|
.hide {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.client-location-flag {
|
||||||
|
width: 3rem;
|
||||||
|
height: 1.5rem;
|
||||||
|
background-image: url('/images/radar/hud_weapons/hud_neutral.png');
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat
|
||||||
|
}
|
||||||
|
@ -39,6 +39,7 @@ $(document).ready(function () {
|
|||||||
$('#actionModal .modal-message').fadeOut('fast');
|
$('#actionModal .modal-message').fadeOut('fast');
|
||||||
$('#actionModal .modal-body-content').html(response);
|
$('#actionModal .modal-body-content').html(response);
|
||||||
$('#actionModal').modal();
|
$('#actionModal').modal();
|
||||||
|
$('#actionModal').trigger('action_form_received', actionType);
|
||||||
})
|
})
|
||||||
.fail(function (jqxhr, textStatus, error) {
|
.fail(function (jqxhr, textStatus, error) {
|
||||||
$('#actionModal .modal-message').text('Error — ' + error);
|
$('#actionModal .modal-message').text('Error — ' + error);
|
||||||
@ -83,4 +84,20 @@ $(document).ready(function () {
|
|||||||
$('#actionModal .modal-message').fadeIn('fast');
|
$('#actionModal .modal-message').fadeIn('fast');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* handle loading of recent clients
|
||||||
|
*/
|
||||||
|
$('#actionModal').off('action_form_received');
|
||||||
|
$('#actionModal').on('action_form_received', function (e, actionType) {
|
||||||
|
if (actionType == 'RecentClients') {
|
||||||
|
const ipAddresses = $('.client-location-flag');
|
||||||
|
$.each(ipAddresses, function (index, address) {
|
||||||
|
$.get('https://ip2c.org/' + $(address).data('ip'), function (result) {
|
||||||
|
const countryCode = result.split(';')[1].toLowerCase();
|
||||||
|
$(address).css('background-image', `url(https://www.countryflags.io/${countryCode}/flat/64.png)`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
@ -1,6 +1,7 @@
|
|||||||
Version 2.4:
|
Version 2.4:
|
||||||
-added "live radar" feature
|
-added "live radar" feature
|
||||||
-added chat message to server on server list view
|
-added chat message to server on server list view
|
||||||
|
-added recently connected players dropdown option on webfront
|
||||||
|
|
||||||
Version 2.3:
|
Version 2.3:
|
||||||
-added configuration option to ignore bots
|
-added configuration option to ignore bots
|
||||||
|
Loading…
x
Reference in New Issue
Block a user