mirror of https://github.com/portainer/portainer
fix(storidge): error on volume IOPS update
parent
f603b335c4
commit
74934beee2
|
@ -46,14 +46,14 @@
|
||||||
<td>Allocated</td>
|
<td>Allocated</td>
|
||||||
<td>{{ $ctrl.volume.Allocated }}</td>
|
<td>{{ $ctrl.volume.Allocated }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>IOPS Max</td>
|
|
||||||
<td>{{ $ctrl.volume.IOPSMax }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>IOPS Min</td>
|
<td>IOPS Min</td>
|
||||||
<td>{{ $ctrl.volume.IOPSMin }}</td>
|
<td>{{ $ctrl.volume.IOPSMin }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>IOPS Max</td>
|
||||||
|
<td>{{ $ctrl.volume.IOPSMax }}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Local Drive Only</td>
|
<td>Local Drive Only</td>
|
||||||
<td>{{ $ctrl.volume.LocalDriveOnly }}</td>
|
<td>{{ $ctrl.volume.LocalDriveOnly }}</td>
|
||||||
|
|
|
@ -18,9 +18,11 @@ function ($state, StoridgeVolumeService, Notifications) {
|
||||||
|
|
||||||
this.initLabels = function() {
|
this.initLabels = function() {
|
||||||
var labels = this.volume.Labels;
|
var labels = this.volume.Labels;
|
||||||
this.formValues.Labels = Object.keys(labels).map(function(key) {
|
if (labels) {
|
||||||
return { name:key, value:labels[key] };
|
this.formValues.Labels = Object.keys(labels).map(function(key) {
|
||||||
});
|
return { name:key, value:labels[key] };
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateVolume = function() {
|
this.updateVolume = function() {
|
||||||
|
@ -68,9 +70,13 @@ function ($state, StoridgeVolumeService, Notifications) {
|
||||||
}
|
}
|
||||||
if (volume.IOPSMin === data.IOPSMin || !volume.IOPSMin) {
|
if (volume.IOPSMin === data.IOPSMin || !volume.IOPSMin) {
|
||||||
delete volume.IOPSMin;
|
delete volume.IOPSMin;
|
||||||
|
} else {
|
||||||
|
volume.IOPSMin = volume.IOPSMin.toString();
|
||||||
}
|
}
|
||||||
if (volume.IOPSMax === data.IOPSMax || !volume.IOPSMax) {
|
if (volume.IOPSMax === data.IOPSMax || !volume.IOPSMax) {
|
||||||
delete volume.IOPSMax;
|
delete volume.IOPSMax;
|
||||||
|
} else {
|
||||||
|
volume.IOPSMax = volume.IOPSMax.toString();
|
||||||
}
|
}
|
||||||
if (volume.BandwidthMin === data.BandwidthMin || !volume.BandwidthMin) {
|
if (volume.BandwidthMin === data.BandwidthMin || !volume.BandwidthMin) {
|
||||||
delete volume.BandwidthMin;
|
delete volume.BandwidthMin;
|
||||||
|
@ -78,6 +84,7 @@ function ($state, StoridgeVolumeService, Notifications) {
|
||||||
if (volume.BandwidthMax === data.BandwidthMax || !volume.BandwidthMax) {
|
if (volume.BandwidthMax === data.BandwidthMax || !volume.BandwidthMax) {
|
||||||
delete volume.BandwidthMax;
|
delete volume.BandwidthMax;
|
||||||
}
|
}
|
||||||
|
this.prepareLabels(volume);
|
||||||
return volume;
|
return volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,7 +92,6 @@ function ($state, StoridgeVolumeService, Notifications) {
|
||||||
this.state.isUpdating = true;
|
this.state.isUpdating = true;
|
||||||
|
|
||||||
var volume = this.prepareVolume();
|
var volume = this.prepareVolume();
|
||||||
this.prepareLabels(volume);
|
|
||||||
volume.Name = this.volume.Name;
|
volume.Name = this.volume.Name;
|
||||||
StoridgeVolumeService.update(volume)
|
StoridgeVolumeService.update(volume)
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
|
|
Loading…
Reference in New Issue