1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-12 21:57:23 +03:00

Check if the image exists to show the resize slider

This commit is contained in:
Daniel Molina 2016-04-15 16:29:52 +02:00
parent 6a1c6e836d
commit 0294ed455f

View File

@ -110,19 +110,22 @@ define(function(require){
var attr;
if (disabled){
attr = UserInputs.parse("SIZE","O|fixed|"+label+"||"+disk.SIZE);
} else {
// Range from original size to size + 500GB
var min = parseInt(disk.SIZE);
var max = min + 512000;
attr = UserInputs.parse(
"SIZE",
"O|range|"+label+"|"+min+".."+max+"|"+min);
if (disk.SIZE) {
if (disabled){
attr = UserInputs.parse("SIZE","O|fixed|"+label+"||"+disk.SIZE);
} else {
// Range from original size to size + 500GB
var min = parseInt(disk.SIZE);
var max = min + 512000;
attr = UserInputs.parse(
"SIZE",
"O|range|"+label+"|"+min+".."+max+"|"+min);
}
UserInputs.insertAttributeInputMB(attr, $(".diskSlider", diskContext));
}
UserInputs.insertAttributeInputMB(attr, $(".diskSlider", diskContext));
})
}
})