summaryrefslogtreecommitdiffstats
path: root/modules-available/backup
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-11 18:00:38 +0100
committerSimon Rettberg2019-12-11 18:00:38 +0100
commit0ef44223568b3ef512b504cc236378bc64fc38a8 (patch)
tree3415e6f21d1dc31b7fb96f03a328dfbf0855d13b /modules-available/backup
parent[serversetup-bwlp-ipxe] Fix updating of default boot entries (diff)
downloadslx-admin-0ef44223568b3ef512b504cc236378bc64fc38a8.tar.gz
slx-admin-0ef44223568b3ef512b504cc236378bc64fc38a8.tar.xz
slx-admin-0ef44223568b3ef512b504cc236378bc64fc38a8.zip
[backup] Disable button during download; add IP to download file name
Diffstat (limited to 'modules-available/backup')
-rw-r--r--modules-available/backup/page.inc.php2
-rw-r--r--modules-available/backup/templates/_page.html6
2 files changed, 5 insertions, 3 deletions
diff --git a/modules-available/backup/page.inc.php b/modules-available/backup/page.inc.php
index 985f39ee..1d69ddd3 100644
--- a/modules-available/backup/page.inc.php
+++ b/modules-available/backup/page.inc.php
@@ -63,7 +63,7 @@ class Page_Backup extends Page
Util::redirect('?do=Backup');
}
Header('Content-Type: application/octet-stream', true);
- Header('Content-Disposition: attachment; filename=' . 'satellite-backup_v16_' . date('Y.m.d-H.i.s') . '.tgz');
+ Header('Content-Disposition: attachment; filename=' . 'satellite-backup_' . Property::getServerIp() . '_' . date('Y.m.d-H.i.s') . '.tgz');
Header('Content-Length: ' . @filesize($task['data']['backupFile']));
while (!feof($fh)) {
$data = fread($fh, 16000);
diff --git a/modules-available/backup/templates/_page.html b/modules-available/backup/templates/_page.html
index 4c6cade4..fa88b966 100644
--- a/modules-available/backup/templates/_page.html
+++ b/modules-available/backup/templates/_page.html
@@ -1,6 +1,6 @@
<h1>{{lang_backupRestore}}</h1>
-<form action="?do=Backup" method="post">
+<form action="?do=Backup" method="post" onsubmit="$('#b-btn').prop('disabled', true).find('span').removeClass('glyphicon-save').addClass('glyphicon-refresh slx-rotation')">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="action" value="backup">
<div class="panel panel-default">
@@ -12,7 +12,9 @@
{{^last_backup}}{{lang_unknown}}{{/last_backup}}
{{last_backup}}
</p>
- <button {{perms.create.disabled}} class="btn btn-primary pull-right" type="submit"><span class="glyphicon glyphicon-save"></span> {{lang_download}}</button>
+ <button id="b-btn" {{perms.create.disabled}} class="btn btn-primary pull-right" type="submit">
+ <span class="glyphicon glyphicon-save"></span> {{lang_download}}
+ </button>
</div>
</div>
</form>