fix(storidge): update 7 - profiles creation + volume details

storidge-standalone
baron_l 2019-04-25 19:23:02 +02:00
parent daacef199a
commit 74382352f8
4 changed files with 17 additions and 2 deletions

View File

@ -54,6 +54,14 @@
<td>IOPS Max</td>
<td>{{ $ctrl.volume.IOPSMax }}</td>
</tr>
<tr>
<td>Bandwidth Min</td>
<td>{{ $ctrl.volume.BandwidthMin }}</td>
</tr>
<tr>
<td>Bandwidth Max</td>
<td>{{ $ctrl.volume.BandwidthMax }}</td>
</tr>
<tr>
<td>Local Drive Only</td>
<td>{{ $ctrl.volume.LocalDriveOnly }}</td>

View File

@ -4,6 +4,8 @@ export function StoridgeVolumeModel(data) {
this.Directory = data.directory;
this.IOPSMax = data.maximumIOPS;
this.IOPSMin = data.minimumIOPS;
this.BandwidthMin = data.minimumBandwidth;
this.BandwidthMax = data.maximumBandwidth;
this.LocalDriveOnly = data.localDriveOnly;
this.Name = data.name;
this.Node = data.node;

View File

@ -100,7 +100,7 @@ function ($scope, $state, $transition$, Notifications, StoridgeProfileService) {
function initView() {
var profile = new StoridgeProfileDefaultModel();
profile.Name = $transition$.params().profileName;
profile.Directory = '/cio/' + _.toLower(profile.Name);
profile.Directory = profile.Directory + _.toLower(profile.Name);
$scope.model = profile;
}

View File

@ -1,3 +1,4 @@
import _ from 'lodash-es';
import { StoridgeProfileDefaultModel } from '../../models/profile';
angular.module('extension.storidge')
@ -37,7 +38,11 @@ function ($q, $scope, $state, Notifications, StoridgeProfileService) {
var model = new StoridgeProfileDefaultModel();
model.Labels = {};
model.Name = $scope.formValues.Name;
model.Directory = model.Directory + model.Name;
model.Directory = model.Directory + _.toLower(model.Name);
delete model.MinBandwidth;
delete model.MaxBandwidth;
delete model.MinIOPS;
delete model.MaxIOPS;
$scope.state.actionInProgress = true;
StoridgeProfileService.create(model)