1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-06-21 21:10:55 +00:00

Changed indentation to match the old one

This commit is contained in:
hija 2020-08-26 19:46:09 +02:00
parent df6fcf3bd2
commit 8085246fed

View File

@ -1,15 +1,15 @@
<style>
#backup-status th { text-align: center; }
#backup-status tr.full-backup td { font-weight: bold; }
</style>
#backup-status th { text-align: center; }
#backup-status tr.full-backup td { font-weight: bold; }
</style>
<h2>Backup Status</h2>
<h2>Backup Status</h2>
<p>The box makes an incremental backup each night. By default the backup is stored on the machine itself, but you can also have it stored on Amazon S3.</p>
<p>The box makes an incremental backup each night. By default the backup is stored on the machine itself, but you can also have it stored on Amazon S3.</p>
<h3>Configuration</h3>
<h3>Configuration</h3>
<form class="form-horizontal" role="form" onsubmit="set_custom_backup(); return false;">
<form class="form-horizontal" role="form" onsubmit="set_custom_backup(); return false;">
<div class="form-group">
<label for="backup-target-type" class="col-sm-2 control-label">Backup to:</label>
<div class="col-sm-2">
@ -137,7 +137,6 @@
<input type="text" placeholder="B2 Bucket" class="form-control" rows="1" id="backup-target-b2-bucket" onchange="compute_b2_url()">
</div>
</div>
<div class="form-group backup-target-b2">
<label for="backup-target-b2-url" class="col-sm-2 control-label">B2 Backup URL</label>
<div class="col-sm-8">
@ -157,13 +156,13 @@
<button id="set-s3-backup-button" type="submit" class="btn btn-primary">Save</button>
</div>
</div>
</form>
</form>
<h3>Available backups</h3>
<h3>Available backups</h3>
<p>The backup location currently contains the backups listed below. The total size of the backups is currently <span id="backup-total-size"></span>.</p>
<p>The backup location currently contains the backups listed below. The total size of the backups is currently <span id="backup-total-size"></span>.</p>
<table id="backup-status" class="table" style="width: auto">
<table id="backup-status" class="table" style="width: auto">
<thead>
<th colspan="2">When</th>
<th>Type</th>
@ -172,18 +171,18 @@
</thead>
<tbody>
</tbody>
</table>
<script>
</table>
<script>
function toggle_form() {
function toggle_form() {
var target_type = $("#backup-target-type").val();
$(".backup-target-local, .backup-target-rsync, .backup-target-s3, .backup-target-b2").hide();
$(".backup-target-" + target_type).show();
init_inputs(target_type);
}
}
function nice_size(bytes) {
function nice_size(bytes) {
var powers = ['bytes', 'KB', 'MB', 'GB', 'TB'];
while (true) {
if (powers.length == 1) break;
@ -197,10 +196,9 @@
else
bytes = Math.round(bytes*10)/10;
return bytes + " " + powers[0];
}
}
function show_system_backup() {
// TODO: b3
function show_system_backup() {
show_custom_backup()
$('#backup-status tbody').html("<tr><td colspan='2' class='text-muted'>Loading...</td></tr>")
@ -246,9 +244,9 @@
total_disk_size += r.unmatched_file_size;
$('#backup-total-size').text(nice_size(total_disk_size));
})
}
}
function show_custom_backup() {
function show_custom_backup() {
$(".backup-target-local, .backup-target-rsync, .backup-target-s3, .backup-target-b2").hide();
api(
"/system/backup/config",
@ -291,9 +289,9 @@
}
toggle_form()
})
}
}
function set_custom_backup() {
function set_custom_backup() {
var target_type = $("#backup-target-type").val();
var target_user = $("#backup-target-user").val();
var target_pass = $("#backup-target-pass").val();
@ -307,7 +305,7 @@
target = "rsync://" + $("#backup-target-rsync-user").val() + "@" + $("#backup-target-rsync-host").val()
+ "/" + $("#backup-target-rsync-path").val();
target_user = '';
} else if (target_type == "b2"){
} else if (target_type == "b2") {
target = $('#backup-target-b2-url').val();
target_user = '';
target_pass = '';
@ -333,9 +331,9 @@
show_modal_error("Backup configuration", $("<p/>").text(r));
});
return false;
}
}
function init_inputs(target_type) {
function init_inputs(target_type) {
function set_host(host) {
if(host !== 'other') {
$("#backup-target-s3-host").val(host);
@ -349,15 +347,14 @@
});
set_host($('#backup-target-s3-host-select').val());
}
}
}
function compute_b2_url(){
function compute_b2_url(){
if ($('#backup-target-b2-user').val() && $('#backup-target-b2-pass').val() && $('#backup-target-b2-bucket').val()){
$('#backup-target-b2-url').val('b2://' + $('#backup-target-b2-user').val() + ':' + $('#backup-target-b2-pass').val()
+ '@' + $('#backup-target-b2-bucket').val());
}else{
$('#backup-target-b2-url').val('');
}
}
</script>
}
</script>