diff --git a/src/views/app.html b/src/views/app.html index 0eb7f669e..471f48206 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -962,9 +962,20 @@

-
-
{{ storage.error.dataDir }}
+ + +
+ +
+ +
{{ storage.error.dataDir }}
+
+ +
+ + +
{{ storage.error.dataPrefix }}
diff --git a/src/views/app.js b/src/views/app.js index ceaeef956..1b4293327 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -681,6 +681,16 @@ angular.module('Application').controller('AppController', ['$scope', '$location' busyDataDir: false, dataDir: null, + dataPrefix: '', + + location: { + id: '', // default, custom, volume+ + type: '', // default, custom, volume + value: '' // emtpy, path, volumeId + }, + + locationOptions: [], + busyBinds: false, mounts: [], // { volume, readOnly } @@ -691,6 +701,23 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.storage.dataDir = app.dataDir; $scope.storage.mounts = []; + $scope.storage.locationOptions = [ + { id: 'default', type: 'default', value: '', displayName: 'Default - /home/yellowtent/appsdata/' }, + { id: 'custom', type: 'custom', value: app.dataDir, displayName: 'Custom Folder Path' } + ]; + + $scope.volumes.forEach(function (volume) { + $scope.storage.locationOptions.push({ id: 'volume-'+volume.id, type: 'volume', value: volume.id, displayName: 'Volume - ' + volume.name }); + }); + + if (!app.dataDir) { + $scope.storage.location = { id: 'default', type: 'default', value: '' }; + } else if (app.dataDir) { + $scope.storage.location = { id: 'custom', type: 'custom', value: app.dataDir }; + } else { + // TODO how to determine volume is used? + } + app.mounts.forEach(function (mount) { // { volumeId, readOnly } var volume = $scope.volumes.find(function (v) { return v.id === mount.volumeId; }); $scope.storage.mounts.push({ volume: volume, readOnly: mount.readOnly });