mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: Fixed root volume resize from ui (#3873)
This PR fixes the volume resize action for a root volume from the UI. Fixes: #3860 #3874
This commit is contained in:
parent
78cc0a44c1
commit
5ae65bfab0
@ -1575,13 +1575,13 @@
|
|||||||
if (newDiskOffering != null && newDiskOffering.length > 0) {
|
if (newDiskOffering != null && newDiskOffering.length > 0) {
|
||||||
array1.push("&diskofferingid=" + encodeURIComponent(newDiskOffering));
|
array1.push("&diskofferingid=" + encodeURIComponent(newDiskOffering));
|
||||||
}
|
}
|
||||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
if (args.context.volumes[0].type == "ROOT" || selectedDiskOfferingObj.iscustomized == true) {
|
||||||
cloudStack.addNewSizeToCommandUrlParameterArrayIfItIsNotNullAndHigherThanZero(array1, args.data.newsize);
|
cloudStack.addNewSizeToCommandUrlParameterArrayIfItIsNotNullAndHigherThanZero(array1, args.data.newsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
var minIops;
|
var minIops;
|
||||||
var maxIops
|
var maxIops
|
||||||
if (selectedDiskOfferingObj.iscustomizediops == true) {
|
if (selectedDiskOfferingObj != null && selectedDiskOfferingObj.iscustomizediops == true) {
|
||||||
minIops = args.data.minIops;
|
minIops = args.data.minIops;
|
||||||
maxIops = args.data.maxIops;
|
maxIops = args.data.maxIops;
|
||||||
}
|
}
|
||||||
@ -1593,13 +1593,12 @@
|
|||||||
if (maxIops != null && maxIops.length > 0) {
|
if (maxIops != null && maxIops.length > 0) {
|
||||||
array1.push("&maxiops=" + encodeURIComponent(maxIops));
|
array1.push("&maxiops=" + encodeURIComponent(maxIops));
|
||||||
}
|
}
|
||||||
//if original disk size > new disk size
|
//if original disk size > new disk size
|
||||||
if ((args.context.volumes[0].type == "ROOT")
|
if (args.context.volumes[0].type == "ROOT" &&
|
||||||
&& (args.context.volumes[0].size > (newSize * (1024 * 1024 * 1024)))) {
|
args.context.volumes[0].size > (args.data.newsize * (1024 * 1024 * 1024))) {
|
||||||
return args.response.error('message.volume.root.shrink.disk.size');
|
return args.response.error('message.volume.root.shrink.disk.size');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("resizeVolume&id=" + args.context.volumes[0].id + array1.join("")),
|
url: createURL("resizeVolume&id=" + args.context.volumes[0].id + array1.join("")),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user