IW4M-Admin/Admin/webfront/main.html

32 lines
1.0 KiB
HTML

<script>
function getServers()
{
$.getJSON("/_servers", function(result){
$("#serverList").html("");
$.each(result, function(i, server){
$("#serverList").append("<div class=serverContainer> \
<div class='serverInfo table'> \
<div class='serverTitle tableCell'>" + server['serverName'] + "</div> \
<div class='serverMap tableCell'>" + server['mapName'] + "</div> \
<div class='serverPlayers tableCell'>" + server['currentPlayers'] + "/" + server['maxPlayers'] + "</div> \
</div> \
<div class='serverChatList table'>" +
formatMessages(server['chatHistory'])
+ "</div> \
<div class='serverPlayerList table'>" +
formatPlayers(server['players'])
+ "</div> \
<div style='clear: both;'></div><hr/></div>"
);
});
});
}
$( document ).ready(function() {
getServers();
setInterval(getServers, 1000)
});
</script>
<div id="serverList">
</div>