Add sshfs volume UI bits
This commit is contained in:
+17
-2
@@ -41,12 +41,12 @@
|
||||
<input type="text" class="form-control" ng-model="volumeConfigure.diskPath" id="volumeConfigureDiskPath" name="diskPath" ng-disabled="volumeConfigure.busy" placeholder="/dev/disk/by-uuid/uuid">
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs' || volumeConfigure.mountType === 'nfs'">
|
||||
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs' || volumeConfigure.mountType === 'nfs' || volumeConfigure.mountType === 'sshfs'">
|
||||
<label class="control-label" for="volumeConfigureHost">{{ 'volumes.addVolumeDialog.server' | tr }}</label>
|
||||
<input type="text" class="form-control" ng-model="volumeConfigure.host" id="volumeConfigureHost" name="host" ng-disabled="volumeConfigure.busy" placeholder="Server IP or hostname">
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs' || volumeConfigure.mountType === 'nfs'">
|
||||
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs' || volumeConfigure.mountType === 'nfs' || volumeConfigure.mountType === 'sshfs'">
|
||||
<label class="control-label" for="volumeConfigureRemoteDir">{{ 'volumes.addVolumeDialog.remoteDirectory' | tr }}</label>
|
||||
<input type="text" class="form-control" ng-model="volumeConfigure.remoteDir" id="volumeConfigureRemoteDir" name="remoteDir" ng-disabled="volumeConfigure.busy" placeholder="/share">
|
||||
</div>
|
||||
@@ -60,6 +60,21 @@
|
||||
<label class="control-label" for="volumeConfigurePassword">{{ 'volumes.addVolumeDialog.password' | tr }}</label>
|
||||
<input type="password" class="form-control" ng-model="volumeConfigure.password" id="volumeConfigurePassword" name="password" ng-disabled="volumeConfigure.busy">
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-show="volumeConfigure.mountType === 'sshfs'">
|
||||
<label class="control-label" for="volumeConfigurePort">{{ 'volumes.addVolumeDialog.port' | tr }}</label>
|
||||
<input type="number" class="form-control" ng-model="volumeConfigure.port" id="volumeConfigurePort" name="port" ng-disabled="volumeConfigure.busy">
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-show="volumeConfigure.mountType === 'sshfs'">
|
||||
<label class="control-label" for="volumeConfigureUser">{{ 'volumes.addVolumeDialog.user' | tr }}</label>
|
||||
<input type="text" class="form-control" ng-model="volumeConfigure.user" id="volumeConfigureUser" name="user" ng-disabled="volumeConfigure.busy">
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-show="volumeConfigure.mountType === 'sshfs'">
|
||||
<label class="control-label" for="volumeConfigurePrivateKey">{{ 'volumes.addVolumeDialog.privateKey' | tr }}</label>
|
||||
<textarea class="form-control" ng-model="volumeConfigure.privateKey" id="volumeConfigurePrivateKey" name="privateKey" ng-disabled="volumeConfigure.busy"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input class="ng-hide" type="submit" ng-disabled="volumeConfigureForm.$invalid || volumeConfigure.busy"/>
|
||||
|
||||
@@ -70,6 +70,9 @@ angular.module('Application').controller('VolumesController', ['$scope', '$locat
|
||||
username: '',
|
||||
password: '',
|
||||
diskPath: '',
|
||||
user: '',
|
||||
port: 22,
|
||||
privateKey: '',
|
||||
|
||||
reset: function () {
|
||||
$scope.volumeConfigure.busy = false;
|
||||
@@ -83,6 +86,9 @@ angular.module('Application').controller('VolumesController', ['$scope', '$locat
|
||||
$scope.volumeConfigure.username = '';
|
||||
$scope.volumeConfigure.password = '';
|
||||
$scope.volumeConfigure.diskPath = '';
|
||||
$scope.volumeConfigure.user = '';
|
||||
$scope.volumeConfigure.port = 22;
|
||||
$scope.volumeConfigure.privateKey = '';
|
||||
|
||||
$scope.volumeConfigureForm.$setPristine();
|
||||
$scope.volumeConfigureForm.$setUntouched();
|
||||
@@ -107,6 +113,12 @@ angular.module('Application').controller('VolumesController', ['$scope', '$locat
|
||||
} else if (volume.mountType === 'nfs') {
|
||||
$scope.volumeConfigure.host = volume.mountOptions.host;
|
||||
$scope.volumeConfigure.remoteDir = volume.mountOptions.remoteDir;
|
||||
} else if (volume.mountType === 'sshfs') {
|
||||
$scope.volumeConfigure.host = volume.mountOptions.host;
|
||||
$scope.volumeConfigure.port = volume.mountOptions.port;
|
||||
$scope.volumeConfigure.remoteDir = volume.mountOptions.remoteDir;
|
||||
$scope.volumeConfigure.user = volume.mountOptions.user;
|
||||
$scope.volumeConfigure.privateKey = volume.mountOptions.privateKey;
|
||||
} else if (volume.mountType === 'ext4') {
|
||||
$scope.volumeConfigure.diskPath = volume.mountOptions.diskPath;
|
||||
}
|
||||
@@ -135,6 +147,14 @@ angular.module('Application').controller('VolumesController', ['$scope', '$locat
|
||||
host: $scope.volumeConfigure.host,
|
||||
remoteDir: $scope.volumeConfigure.remoteDir,
|
||||
};
|
||||
} else if ($scope.volumeConfigure.mountType === 'sshfs') {
|
||||
mountOptions = {
|
||||
host: $scope.volumeConfigure.host,
|
||||
port: $scope.volumeConfigure.port,
|
||||
remoteDir: $scope.volumeConfigure.remoteDir,
|
||||
user: $scope.volumeConfigure.user,
|
||||
privateKey: $scope.volumeConfigure.privateKey,
|
||||
};
|
||||
} else if ($scope.volumeConfigure.mountType === 'ext4') {
|
||||
mountOptions = {
|
||||
diskPath: $scope.volumeConfigure.diskPath
|
||||
|
||||
Reference in New Issue
Block a user