mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 04:15:28 +02:00
* feat(volume-creation): NFS support for volume creation - layout * feat(volume-creation): NFS support for volume creation * fix(volume-creation): NFS style, display and check on submit * refactor(volume-creation): remove useless controller + refactor var naming * refactor(volume-creation): NFS wording, help and style
This commit is contained in:
parent
ee9c8d7d1a
commit
5222413532
5 changed files with 131 additions and 8 deletions
|
@ -6,7 +6,8 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
|
|||
Driver: 'local',
|
||||
DriverOptions: [],
|
||||
AccessControlData: new AccessControlFormData(),
|
||||
NodeName: null
|
||||
NodeName: null,
|
||||
NFSData: new VolumesNFSFormData()
|
||||
};
|
||||
|
||||
$scope.state = {
|
||||
|
@ -36,8 +37,19 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
|
|||
return true;
|
||||
}
|
||||
|
||||
$scope.create = function () {
|
||||
function prepareNFSConfiguration(driverOptions) {
|
||||
var data = $scope.formValues.NFSData;
|
||||
|
||||
driverOptions.push({ name: 'type', value: data.version.toLowerCase() });
|
||||
|
||||
var options = 'addr=' + data.serverAddress + ',' + data.options;
|
||||
driverOptions.push({ name: 'o', value: options });
|
||||
|
||||
var mountPoint = data.mountPoint[0] === ':' ? data.mountPoint : ':' + data.mountPoint;
|
||||
driverOptions.push({ name: 'device', value: mountPoint });
|
||||
}
|
||||
|
||||
$scope.create = function () {
|
||||
var name = $scope.formValues.Name;
|
||||
var driver = $scope.formValues.Driver;
|
||||
var driverOptions = $scope.formValues.DriverOptions;
|
||||
|
@ -47,6 +59,10 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
|
|||
driverOptions.push({ name: 'profile', value: storidgeProfile.Name });
|
||||
}
|
||||
|
||||
if ($scope.formValues.NFSData.useNFS) {
|
||||
prepareNFSConfiguration(driverOptions);
|
||||
}
|
||||
|
||||
var volumeConfiguration = VolumeService.createVolumeConfiguration(name, driver, driverOptions);
|
||||
var accessControlData = $scope.formValues.AccessControlData;
|
||||
var userDetails = Authentication.getUserDetails();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue