cosmetic changes

This commit is contained in:
rlx 2016-01-12 08:29:28 +05:30
parent 704a93e2f1
commit eb648284a6

View file

@ -11,7 +11,7 @@ function load() {
ws.onclose = function(event) {
setTimeout(load, 500);
};
};
}
function update() {
var xhr = new XMLHttpRequest();
@ -25,20 +25,19 @@ function update() {
document.getElementById('status').innerHTML = status;
setTimeout(update, 1000);
} else {
document.getElementById('status').innerHTML = "done";
document.getElementById('status').innerHTML = 'done';
setTimeout(load, 500);
}
};
xhr.onerror = function() {
var status = document.getElementById('status').innerHTML;
if (['done', 'setup'].indexOf(status) == -1) {
document.getElementById('status').innerHTML = "error";
document.getElementById('status').innerHTML = 'error';
}
load();
}
xhr.open('get', '/status');
xhr.send();
}
update();