1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-25 07:47:05 +00:00

Hide the 'Create Backup' buttons when backups are turned off

This commit is contained in:
David Duque 2020-07-11 15:45:50 +01:00
parent ccf60c7017
commit b562e7eefa
No known key found for this signature in database
GPG Key ID: 2F327738A3C0AE3A

View File

@ -141,8 +141,9 @@
</tbody> </tbody>
</table> </table>
<button id="create-full-backup-button" class="btn btn-primary" onclick="do_backup(true)">Create Full Backup Now</button> <!-- Hide these buttons until we're sure we can use them :) -->
<button id="create-incremental-backup-button" class="btn btn-primary" onclick="do_backup(false)">Create Incremental Backup Now</button> <button id="create-full-backup-button" class="btn btn-primary" onclick="do_backup(true)" style="display: none;">Create Full Backup Now</button>
<button id="create-incremental-backup-button" class="btn btn-primary" onclick="do_backup(false)" style="display: none;">Create Incremental Backup Now</button>
<script> <script>
@ -190,10 +191,14 @@ function show_system_backup() {
if (typeof r.backups == "undefined") { if (typeof r.backups == "undefined") {
var tr = $('<tr><td colspan="3">Backups are turned off.</td></tr>'); var tr = $('<tr><td colspan="3">Backups are turned off.</td></tr>');
$('#backup-status tbody').append(tr); $('#backup-status tbody').append(tr);
$('#create-full-backup-button').css("display","none")
$('#create-incremental-backup-button').css("display","none")
return; return;
} else if (r.backups.length == 0) { } else if (r.backups.length == 0) {
var tr = $('<tr><td colspan="3">No backups have been made yet.</td></tr>'); var tr = $('<tr><td colspan="3">No backups have been made yet.</td></tr>');
$('#backup-status tbody').append(tr); $('#backup-status tbody').append(tr);
$('#create-full-backup-button').css("display","unset")
$('#create-incremental-backup-button').css("display","unset")
} }
for (var i = 0; i < r.backups.length; i++) { for (var i = 0; i < r.backups.length; i++) {