Commit 2aaa7192 authored by Franco Fichtner's avatar Franco Fichtner

firmware: always schedule next poll

This avoids akward scenarios when the webserver is reloading,
spitting out temporary messages.  In that case, simply keep
polling until the request is back.  The backend keeps running
anyway.
parent 313a8f2a
...@@ -140,10 +140,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -140,10 +140,7 @@ POSSIBILITY OF SUCH DAMAGE.
$('#update_status').html(data['log']); $('#update_status').html(data['log']);
$('#update_status').scrollTop($('#update_status')[0].scrollHeight); $('#update_status').scrollTop($('#update_status')[0].scrollHeight);
} }
if (data['status'] == 'running' || data['status'] == 'error') { if (data['status'] == 'done') {
// schedule next poll
setTimeout(trackStatus, 500);
} else if (data['status'] == 'done') {
$('#updatestatus').html("{{ lang._('Upgrade done!') }}"); $('#updatestatus').html("{{ lang._('Upgrade done!') }}");
} else if (data['status'] == 'reboot') { } else if (data['status'] == 'reboot') {
// reboot required, tell the user to wait until this is finished and redirect after 5 minutes // reboot required, tell the user to wait until this is finished and redirect after 5 minutes
...@@ -169,7 +166,9 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -169,7 +166,9 @@ POSSIBILITY OF SUCH DAMAGE.
} }
}] }]
}); });
} else {
// schedule next poll
setTimeout(trackStatus, 500);
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment