mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-07-05 03:19:08 -05:00
few more small fixes
complete join button on webfront update for 2.2.6.0
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Dtos;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace WebfrontCore.ViewComponents
|
||||
{
|
||||
@ -10,6 +11,7 @@ namespace WebfrontCore.ViewComponents
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
var servers = Program.Manager.GetServers();
|
||||
|
||||
var serverInfo = servers.Select(s => new ServerInfo()
|
||||
{
|
||||
Name = s.Hostname,
|
||||
@ -30,7 +32,8 @@ namespace WebfrontCore.ViewComponents
|
||||
}).ToList(),
|
||||
ChatHistory = s.ChatHistory.ToList(),
|
||||
Online = !s.Throttled,
|
||||
ConnectProtocolUrl = s.EventParser.URLProtocolFormat.FormatExt(s.IP, s.GetPort())
|
||||
IPAddress = $"{(IPAddress.Parse(s.IP).IsInternal() ? Program.Manager.ExternalIPAddress : s.IP)}:{s.GetPort()}",
|
||||
ConnectProtocolUrl = s.EventParser.URLProtocolFormat.FormatExt(IPAddress.Parse(s.IP).IsInternal() ? Program.Manager.ExternalIPAddress : s.IP, s.GetPort())
|
||||
}).ToList();
|
||||
return View("_List", serverInfo);
|
||||
}
|
||||
|
@ -7,7 +7,8 @@
|
||||
<div class="col-md-4 text-center text-md-left d-inline-flex justify-content-center justify-content-md-start">
|
||||
<span>@Model.Name</span>
|
||||
<a href="@Model.ConnectProtocolUrl" class="ml-2 align-self-center d-none d-md-flex server-join-button" title="@SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_HOME_JOIN_DESC"]">
|
||||
<span class="oi oi-play-circle"></span>
|
||||
<span class="oi oi-play-circle mr-2 align-self-center"></span>
|
||||
<span class="server-header-ip-address" style="display:none;">@Model.IPAddress</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center col-md-4">@Model.Map</div>
|
||||
|
@ -89,4 +89,10 @@ function refreshClientActivity() {
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.server-join-button').click(function (e) {
|
||||
$(this).children('.server-header-ip-address').show();
|
||||
});
|
||||
})
|
||||
|
||||
setInterval(refreshClientActivity, 2000);
|
||||
|
Reference in New Issue
Block a user