diff --git a/dashboard/src/views/app.html b/dashboard/src/views/app.html
index dc71b47bc..ee6d86332 100644
--- a/dashboard/src/views/app.html
+++ b/dashboard/src/views/app.html
@@ -335,20 +335,26 @@
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
@@ -360,14 +366,14 @@
-
-
+
+
-
-
+
+
@@ -378,26 +384,26 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/dashboard/src/views/app.js b/dashboard/src/views/app.js
index a36923652..59fc46a13 100644
--- a/dashboard/src/views/app.js
+++ b/dashboard/src/views/app.js
@@ -1433,7 +1433,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
provider: '',
bucket: '',
prefix: '',
- mountPoint: '',
+ mountPoint: '', // for mountpoint
accessKeyId: '',
secretAccessKey: '',
gcsKey: { keyFileName: '', content: '' },
@@ -1492,7 +1492,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
// only set provider specific fields, this will clear them in the db
if ($scope.s3like(backupConfig.provider)) {
backupConfig.bucket = $scope.importBackup.bucket;
- backupConfig.prefix = '';
+ backupConfig.prefix = $scope.importBackup.prefix;
backupConfig.accessKeyId = $scope.importBackup.accessKeyId;
backupConfig.secretAccessKey = $scope.importBackup.secretAccessKey;
@@ -1539,7 +1539,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
} else if (backupConfig.provider === 'gcs') {
backupConfig.bucket = $scope.importBackup.bucket;
- backupConfig.prefix = '';
+ backupConfig.prefix = $scope.importBackup.prefix;
try {
var serviceAccountKey = JSON.parse($scope.importBackup.gcsKey.content);
backupConfig.projectId = serviceAccountKey.project_id;
@@ -1559,9 +1559,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
} else if (backupConfig.provider === 'sshfs' || backupConfig.provider === 'cifs' || backupConfig.provider === 'nfs' || backupConfig.provider === 'ext4' || backupConfig.provider === 'xfs') {
backupConfig.mountOptions = $scope.importBackup.mountOptions;
- backupConfig.prefix = '';
+ backupConfig.prefix = $scope.importBackup.prefix;
} else if (backupConfig.provider === 'mountpoint') {
- backupConfig.prefix = '';
+ backupConfig.prefix = $scope.importBackup.prefix;
backupConfig.mountPoint = $scope.importBackup.mountPoint;
} else if (backupConfig.provider === 'filesystem') {
var parts = remotePath.split('/');
@@ -2240,13 +2240,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
var backupConfig;
try {
backupConfig = JSON.parse(result.target.result);
- let prefix = backupConfig.prefix;
- backupConfig.prefix = ''; // so it can clear the form as well when we apply keys below
- if (backupConfig.provider === 'filesystem') { // patch the remotePath to have the full path
- backupConfig.remotePath = (prefix ? prefix + '/' : '') + backupConfig.backupFolder + '/' + backupConfig.remotePath;
+ if (backupConfig.provider === 'filesystem') { // this allows a user to upload a backup to server and import easily with an absolute path
+ backupConfig.remotePath = backupConfig.backupFolder + '/' + backupConfig.remotePath;
delete backupConfig.backupFolder;
- } else {
- backupConfig.remotePath = (prefix ? prefix + '/' : '') + backupConfig.remotePath;
}
} catch (e) {
console.error('Unable to parse backup config');