Auto-reload server status every 15 sec
This commit is contained in:
parent
66612c01ec
commit
6323a7d128
@ -1,3 +1,4 @@
|
||||
function getStatus() {
|
||||
MinecraftAPI.getServerStatus('panic-shack.hallada.net', {
|
||||
port: 25565
|
||||
}, function (err, status) {
|
||||
@ -27,3 +28,10 @@ MinecraftAPI.getServerStatus('panic-shack.hallada.net', {
|
||||
document.getElementById('status-last-online').textContent = moment.unix(parseInt(status.last_online, 10)).fromNow();
|
||||
document.getElementById('status-last-updated').textContent = moment.unix(parseInt(status.last_updated, 10)).fromNow();
|
||||
});
|
||||
}
|
||||
|
||||
getStatus();
|
||||
|
||||
setInterval(function () {
|
||||
getStatus();
|
||||
}, 15000);
|
||||
|
Loading…
Reference in New Issue
Block a user