cosmetic changes
This commit is contained in:
parent
704a93e2f1
commit
eb648284a6
1 changed files with 3 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue