// ask master for slaves and render them nicely on a page with production graphs setTimeout(function() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { var slaveData = JSON.parse(xmlhttp.responseText); var HTML = "
Current connections:
" for(i=0;iID: " + slaveData[key].unique + "
Last seen: "+seenDate+"
Online players: "+slaveData[key].playerCount+"
IP: "+slaveData[key].publicIP +":"+ slaveData[key].serverPort+"
" HTML += "Host: "+slaveData[key].mac+"
"; HTML += ""; } } document.querySelector("#slaves > #display").innerHTML = HTML } } xmlhttp.open("GET", "api/slaves", true); xmlhttp.send(); }, 0)