Fix incorrect display of non-absolute paths
This commit is contained in:
parent
eb6d519282
commit
616d6607e6
1 changed files with 5 additions and 3 deletions
|
@ -278,11 +278,13 @@ function show_custom_backup() {
|
||||||
$("#backup-target-type").val("off");
|
$("#backup-target-type").val("off");
|
||||||
} else if (r.target.substring(0, 8) == "rsync://") {
|
} else if (r.target.substring(0, 8) == "rsync://") {
|
||||||
$("#backup-target-type").val("rsync");
|
$("#backup-target-type").val("rsync");
|
||||||
var path = r.target.substring(8).split('//');
|
let uri = r.target.substring(8)
|
||||||
var host_parts = path.shift().split('@');
|
let i = uri.indexOf("/")
|
||||||
|
let path = [uri.slice(0, i), uri.slice(i + 1)];
|
||||||
|
let host_parts = path.shift().split('@');
|
||||||
$("#backup-target-rsync-user").val(host_parts[0]);
|
$("#backup-target-rsync-user").val(host_parts[0]);
|
||||||
$("#backup-target-rsync-host").val(host_parts[1]);
|
$("#backup-target-rsync-host").val(host_parts[1]);
|
||||||
$("#backup-target-rsync-path").val('/'+path[0]);
|
$("#backup-target-rsync-path").val(path[0]);
|
||||||
$("#backup-target-rsync-port").val(r.target_rsync_port)
|
$("#backup-target-rsync-port").val(r.target_rsync_port)
|
||||||
} else if (r.target.substring(0, 5) == "s3://") {
|
} else if (r.target.substring(0, 5) == "s3://") {
|
||||||
$("#backup-target-type").val("s3");
|
$("#backup-target-type").val("s3");
|
||||||
|
|
Loading…
Reference in a new issue