summaryrefslogtreecommitdiffstats
path: root/templates/backup/restore.html
diff options
context:
space:
mode:
authorSimon Rettberg2014-11-28 18:03:57 +0100
committerSimon Rettberg2014-11-28 18:03:57 +0100
commit1da8eeb6246efe22d0121b58063e7b98a527980b (patch)
treea914fb98f478eaf9fffcf6d83d1557e03045530a /templates/backup/restore.html
parentReturn status code 500 on Util::traceError() (diff)
downloadslx-admin-1da8eeb6246efe22d0121b58063e7b98a527980b.tar.gz
slx-admin-1da8eeb6246efe22d0121b58063e7b98a527980b.tar.xz
slx-admin-1da8eeb6246efe22d0121b58063e7b98a527980b.zip
Wait for reboot to complete after restoring a configuration backup
Diffstat (limited to 'templates/backup/restore.html')
-rw-r--r--templates/backup/restore.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/templates/backup/restore.html b/templates/backup/restore.html
index 3e29dbdc..2e33beb3 100644
--- a/templates/backup/restore.html
+++ b/templates/backup/restore.html
@@ -12,6 +12,9 @@
<div id="restorefailed" class="alert alert-danger" style="display:none">
{{lang_restoreFailed}}
</div>
+ <div id="waiting" style="display:none">
+ <span id="dots"></span>
+ </div>
</div>
</div>
@@ -23,5 +26,33 @@
if (task.statusCode === 'TASK_ERROR') {
$('#restorefailed').show('slow');
}
+ if (task.statusCode === 'TASK_ERROR' || task.statusCode === 'TASK_FINISHED') {
+ startRebootPoll();
+ }
+ }
+
+ function startRebootPoll()
+ {
+ $('#waiting').show();
+ $('#waiting').prepend('<span class="glyphicon glyphicon-refresh slx-rotation"></span>');
+ $('#dots').text('{{lang_waitReboot}}');
+ slxDotInterval = setInterval(function() { $('#dots').text($('#dots').text() + '..'); }, 3000);
+ setTimeout('rebootPoll()', 10000);
+ }
+
+ function rebootPoll()
+ {
+ if (slxDotInterval !== false) {
+ clearInterval(slxDotInterval);
+ slxDotInterval = false;
+ }
+ $('#dots').text($('#dots').text() + '..');
+ slxTimeoutId = setTimeout('rebootPoll()', 3500);
+ $.ajax({url: "index.php?do=Main", timeout: 3000}).success(function(data, textStatus, jqXHR) {
+ if (textStatus !== "success" && textStatus !== "notmodified")
+ return;
+ clearTimeout(slxTimeoutId);
+ window.location.replace("index.php?do=Main&message[]=success%7Crestore-done");
+ });
}
</script>