13 lines
336 B
JavaScript
13 lines
336 B
JavaScript
$(document).ready(function () {
|
|
$('.serverItem').each(function() {
|
|
setInterval(updateServer, 5000, $(this));
|
|
});
|
|
});
|
|
|
|
function updateServer(elem) {
|
|
var serverName = elem.data('server-name');
|
|
$.get('/server/' + serverName + '/status', function(data, state) {
|
|
elem.children('.serverState').eq(0).text(data.state);
|
|
});
|
|
}
|