diff --git a/css/style.css b/css/style.css index 0d9f1ca..c06084a 100644 --- a/css/style.css +++ b/css/style.css @@ -36,7 +36,7 @@ p, a { /* STATUS */ /* ****** */ -.serverstatus p { +.serverstatus p, .serverstatus .label .fa { margin: 0 } diff --git a/js/status.js b/js/status.js index fa85c78..a7feb78 100644 --- a/js/status.js +++ b/js/status.js @@ -1,11 +1,10 @@ $(document).ready(function () { - checkStatus(); var intervalid = setInterval(function () { checkStatus(); }, 10 * 1000); -}) +}); function checkStatus() { @@ -27,10 +26,27 @@ function checkStatus() { var averagePacketloss = Math.round(json.averagePacketloss * 100) / 100; var averagePing = Math.round(json.averagePing * 100) / 100; + var platformIcon = ''; + + switch (platform.toLowerCase()) { + case "windows": + platformIcon = platformIcon.replace(/%s/, 'fa-windows'); + break; + case "linux": + platformIcon = platformIcon.replace(/%s/, 'fa-linux'); + break; + case "os x": + case "macos": + platformIcon = platformIcon.replace(/%s/, 'fa-apple'); + break; + default: + platformIcon = platform; + } + result = '

' + statusOnline + ': ' + clientsonline + ' / ' + maxclients + ' (' + clientsprecent + '%)

' + '

' + statusUptime + ': ' + uptime + '

' + - '

' + statusVersion + ': ' + version + ' @ ' + platform + '

' + + '

' + statusVersion + ': ' + version + ' on ' + platformIcon + '

' + '

' + statusAvgping + ': ' + averagePing + ' ms

' + '

' + statusAvgpl + ': ' + averagePacketloss + '%

'; } else {