compute: Fixing rootdisk size override in deploy vm form (#542)

Addresses an issue from #520

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
davidjumani 2020-07-16 10:43:35 +05:30 committed by Rohit Yadav
parent c08e954717
commit efc11e8131
2 changed files with 5 additions and 3 deletions

View File

@ -960,7 +960,8 @@ export default {
})
const templates = this.options.templates.filter(x => x.id === value)
if (templates.length > 0) {
this.dataPreFill.minrootdisksize = templates[0].size / (1024 * 1024 * 1024) || 0 // bytes to GB
var size = templates[0].size / (1024 * 1024 * 1024) || 0 // bytes to GB
this.dataPreFill.minrootdisksize = Math.ceil(size)
}
} else if (name === 'isoid') {
this.tabKey = 'isoid'
@ -1065,7 +1066,7 @@ export default {
} else {
deployVmData.templateid = values.isoid
}
if (values.rootdisksize && values.rootdisksize > 0) {
if (this.showRootDiskSizeChanger && values.rootdisksize && values.rootdisksize > 0) {
deployVmData.rootdisksize = values.rootdisksize
}
if (values.hypervisor && values.hypervisor.length > 0) {

View File

@ -53,8 +53,9 @@ export default {
},
watch: {
minDiskSize (newItem) {
if (this.inputValue < newItem) {
if (newItem && newItem > 0) {
this.inputValue = newItem
this.updateDiskSize(newItem)
}
}
},