summaryrefslogtreecommitdiffstats
path: root/modules-available/backup/templates
diff options
context:
space:
mode:
authorSimon Rettberg2023-03-02 16:07:01 +0100
committerSimon Rettberg2023-03-02 16:07:01 +0100
commitd7f11c6543bfff777df7bd533e1d04ff8a48b81c (patch)
tree0c6b4a7eafc482d75ef19b407b22578691e2a7da /modules-available/backup/templates
parent[backup] Add UI for monthly automatic backup + password support (diff)
downloadslx-admin-d7f11c6543bfff777df7bd533e1d04ff8a48b81c.tar.gz
slx-admin-d7f11c6543bfff777df7bd533e1d04ff8a48b81c.tar.xz
slx-admin-d7f11c6543bfff777df7bd533e1d04ff8a48b81c.zip
[backup] Check supplied backup file before trying to apply
This saves us from aborting midway and doing a reboot
Diffstat (limited to 'modules-available/backup/templates')
-rw-r--r--modules-available/backup/templates/_page.html7
-rw-r--r--modules-available/backup/templates/restore.html10
-rw-r--r--modules-available/backup/templates/task-error.html6
3 files changed, 18 insertions, 5 deletions
diff --git a/modules-available/backup/templates/_page.html b/modules-available/backup/templates/_page.html
index 52dd7e72..2fb89b18 100644
--- a/modules-available/backup/templates/_page.html
+++ b/modules-available/backup/templates/_page.html
@@ -30,8 +30,8 @@
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="action" value="restore">
<div class="panel panel-default">
- <div class="panel-heading">{{lang_restore}}</div>
- <div class="panel-body {{perms.restore.disabled}}">
+ <div class="panel-heading">{{lang_restoreHeading}}{{#id_prefix}} – <b>{{.}}</b>{{/id_prefix}}</div>
+ <div class="panel-body {{perms.restore.disabled}}" {{#id_color}}style="border:5px solid {{.}}"{{/id_color}}>
<p>{{lang_restoreDescription}}</p>
<label for="file-out">{{lang_restoreFileLabel}}</label>
<div class="input-group upload-ex">
@@ -68,7 +68,8 @@
</div>
<button {{perms.restore.disabled}} class="btn btn-primary pull-right" type="submit">
<span class="glyphicon glyphicon-open"></span>
- {{lang_restore}}
+ {{lang_restoreButton}}
+ {{#id_prefix}} – {{.}}{{/id_prefix}}
</button>
</div>
</div>
diff --git a/modules-available/backup/templates/restore.html b/modules-available/backup/templates/restore.html
index c9c19d2b..3e57a3ee 100644
--- a/modules-available/backup/templates/restore.html
+++ b/modules-available/backup/templates/restore.html
@@ -20,6 +20,7 @@
<script type="text/javascript">
var slxDotInterval = false;
+ var restoreSuccess = false;
function restoreCb(task)
{
if (!task || !task.statusCode)
@@ -28,6 +29,7 @@
$('#restorefailed').show('slow');
}
if (task.statusCode === 'TASK_ERROR' || task.statusCode === 'TASK_FINISHED') {
+ restoreSuccess = (task.statusCode === 'TASK_FINISHED');
startRebootPoll();
}
}
@@ -48,14 +50,18 @@
}
$('#dots').text($('#dots').text() + '..');
slxTimeoutId = setTimeout(rebootPoll, 3500);
- $.ajax({url: "index.php?do=Main", timeout: 3000}).success(function(data, textStatus, jqXHR) {
+ $.ajax({url: "?do=main", timeout: 3000}).success(function(data, textStatus, jqXHR) {
if (textStatus !== "success" && textStatus !== "notmodified")
return;
if (data.indexOf('Status: DB running') === -1)
return;
clearTimeout(slxTimeoutId);
setTimeout(function() {
- window.location.replace("index.php?do=Main&message[]=success%7Cbackup.restore-done");
+ if (restoreSuccess) {
+ window.location.replace("?do=main&message[]=success%7Cbackup.restore-done");
+ } else {
+ window.location.replace("?do=main");
+ }
}, 3500);
});
}
diff --git a/modules-available/backup/templates/task-error.html b/modules-available/backup/templates/task-error.html
new file mode 100644
index 00000000..56837799
--- /dev/null
+++ b/modules-available/backup/templates/task-error.html
@@ -0,0 +1,6 @@
+<div class="panel panel-default">
+ <div class="panel-heading panel-danger">{{lang_error}}</div>
+ <div class="panel-body">
+ <div data-tm-id="{{taskid}}" data-tm-log="messages">{{lang_checkingArchive}}</div>
+ </div>
+</div>