mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix disk offering override in VM deployment wizard (#8070)
* Fix disk offering override in VM deployment wizard * Reduce indentation
This commit is contained in:
parent
223a9b8031
commit
d487a1c341
@ -1331,36 +1331,20 @@ export default {
|
||||
}
|
||||
|
||||
this.serviceOffering = _.find(this.options.serviceOfferings, (option) => option.id === instanceConfig.computeofferingid)
|
||||
if (this.serviceOffering?.diskofferingid) {
|
||||
if (iso) {
|
||||
this.diskOffering = _.find(this.options.diskOfferings, (option) => option.id === this.serviceOffering.diskofferingid)
|
||||
} else {
|
||||
instanceConfig.overridediskofferingid = this.serviceOffering.diskofferingid
|
||||
}
|
||||
}
|
||||
if (!iso && this.diskSelected) {
|
||||
this.diskOffering = _.find(this.options.diskOfferings, (option) => option.id === instanceConfig.diskofferingid)
|
||||
}
|
||||
if (this.rootDiskSelected?.id) {
|
||||
instanceConfig.overridediskofferingid = this.rootDiskSelected.id
|
||||
}
|
||||
|
||||
instanceConfig.overridediskofferingid = this.rootDiskSelected?.id || this.serviceOffering?.diskofferingid
|
||||
if (instanceConfig.overridediskofferingid) {
|
||||
this.overrideDiskOffering = _.find(this.options.diskOfferings, (option) => option.id === instanceConfig.overridediskofferingid)
|
||||
} else {
|
||||
this.overrideDiskOffering = null
|
||||
}
|
||||
|
||||
if (!iso && this.diskSelected) {
|
||||
if (iso && this.serviceOffering?.diskofferingid) {
|
||||
this.diskOffering = _.find(this.options.diskOfferings, (option) => option.id === this.serviceOffering.diskofferingid)
|
||||
} else if (!iso && this.diskSelected) {
|
||||
this.diskOffering = _.find(this.options.diskOfferings, (option) => option.id === instanceConfig.diskofferingid)
|
||||
}
|
||||
if (this.rootDiskSelected?.id) {
|
||||
instanceConfig.overridediskofferingid = this.rootDiskSelected.id
|
||||
}
|
||||
if (instanceConfig.overridediskofferingid) {
|
||||
this.overrideDiskOffering = _.find(this.options.diskOfferings, (option) => option.id === instanceConfig.overridediskofferingid)
|
||||
} else {
|
||||
this.overrideDiskOffering = null
|
||||
}
|
||||
|
||||
this.zone = _.find(this.options.zones, (option) => option.id === instanceConfig.zoneid)
|
||||
this.affinityGroups = _.filter(this.options.affinityGroups, (option) => _.includes(instanceConfig.affinitygroupids, option.id))
|
||||
this.networks = this.getSelectedNetworksWithExistingConfig(_.filter(this.options.networks, (option) => _.includes(instanceConfig.networkids, option.id)))
|
||||
@ -1637,6 +1621,7 @@ export default {
|
||||
this.showRootDiskSizeChanger = false
|
||||
} else {
|
||||
this.rootDiskSelected = null
|
||||
this.form.overridediskofferingid = undefined
|
||||
}
|
||||
this.showOverrideDiskOfferingOption = val
|
||||
},
|
||||
@ -1875,7 +1860,6 @@ export default {
|
||||
if (this.loading.deploy) return
|
||||
this.formRef.value.validate().then(async () => {
|
||||
const values = toRaw(this.form)
|
||||
|
||||
if (!values.templateid && !values.isoid) {
|
||||
this.$notification.error({
|
||||
message: this.$t('message.request.failed'),
|
||||
@ -1962,7 +1946,7 @@ export default {
|
||||
if (this.selectedTemplateConfiguration) {
|
||||
deployVmData['details[0].configurationId'] = this.selectedTemplateConfiguration.id
|
||||
}
|
||||
if (!this.serviceOffering.diskofferingstrictness && values.overridediskofferingid) {
|
||||
if (!this.serviceOffering.diskofferingstrictness && values.overridediskofferingid && !values.isoid) {
|
||||
deployVmData.overridediskofferingid = values.overridediskofferingid
|
||||
if (values.rootdisksize && values.rootdisksize > 0) {
|
||||
deployVmData.rootdisksize = values.rootdisksize
|
||||
|
||||
@ -227,6 +227,7 @@ export default {
|
||||
this.selectedRowKeys = value
|
||||
this.$emit('select-disk-offering-item', value[0])
|
||||
this.$emit('on-selected-disk-size', this.diskSelected)
|
||||
this.$emit('on-selected-root-disk-size', this.diskSelected)
|
||||
},
|
||||
handleSearch (value) {
|
||||
this.filter = value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user