🚑 Fix nextcloud modal not showing if conf is empty

This commit is contained in:
Sebastien Clement 2021-01-09 01:08:19 +01:00
parent 84c3027d97
commit 18657e37ce
2 changed files with 15 additions and 3 deletions

View File

@ -278,8 +278,16 @@ function getNextcloudSettings() {
$('#username').val(data.username);
$('#password').val(data.password);
$('#back-dir').val(data.back_dir);
loadingModal.hide();
nextcloud_setting_modal.show();
}).fail((error) => {
if (error.status === 404)
nextcloud_setting_modal.show();
else {
console.log(error);
create_toast("error", "Fail to fetch Nextcloud config !", default_toast_timeout);
}
}).always(() => {
loadingModal.hide();
});
}
@ -358,10 +366,14 @@ function getBackupSettings() {
}
$("#addons-div").html(addons_html);
updateDropVisibility();
loadingModal.hide();
backup_setting_modal.show();
}).fail((error) => {
console.log(error);
create_toast("error", "Fail to fetch Nextcloud config !", default_toast_timeout);
}).always(() => {
loadingModal.hide();
});
}

View File

@ -55,7 +55,7 @@
<div class="row mt-3">
<div class="col-12">
<label for="back-dir" class="form-label">Backup Directory</label>
<input id="back-dir" type="text" class="form-control" aria-describedby="dir-help">
<input id="back-dir" type="text" class="form-control" aria-describedby="dir-help" placeholder="/Hassio Backup/">
<div id="dir-help" class="form-text">Default: /Hassio Backup/</div>
</div>
</div>