mirror of https://github.com/apache/cloudstack.git
Refactoring and cleanup
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
36a5121165
commit
8ec7c72d15
|
|
@ -1189,6 +1189,7 @@ export default {
|
|||
for (const key in this.options.templates) {
|
||||
var t = _.find(_.get(this.options.templates[key], 'template', []), (option) => option.id === value)
|
||||
if (t) {
|
||||
this.template = t
|
||||
this.templateConfigurations = []
|
||||
this.selectedTemplateConfiguration = {}
|
||||
this.templateNics = []
|
||||
|
|
@ -1281,6 +1282,14 @@ export default {
|
|||
e.preventDefault()
|
||||
this.form.validateFields(async (err, values) => {
|
||||
if (err) {
|
||||
if (err.licensesaccepted) {
|
||||
this.$notification.error({
|
||||
message: this.$t('message.license.agreements.not.accepted'),
|
||||
description: this.$t('message.step.license.agreements.continue')
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.$notification.error({
|
||||
message: this.$t('message.request.failed'),
|
||||
description: this.$t('error.form.message')
|
||||
|
|
@ -1308,13 +1317,6 @@ export default {
|
|||
})
|
||||
return
|
||||
}
|
||||
if ('licensesaccepted' in values && values.licensesaccepted !== true) {
|
||||
this.$notification.error({
|
||||
message: this.$t('message.license.agreements.not.accepted'),
|
||||
description: this.$t('message.step.license.agreements.continue')
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.loading.deploy = true
|
||||
|
||||
|
|
@ -1432,6 +1434,7 @@ export default {
|
|||
const title = this.$t('label.launch.vm')
|
||||
const description = values.name || ''
|
||||
const password = this.$t('label.password')
|
||||
|
||||
api('deployVirtualMachine', deployVmData).then(response => {
|
||||
const jobId = response.deployvirtualmachineresponse.jobid
|
||||
if (jobId) {
|
||||
|
|
@ -1796,14 +1799,16 @@ export default {
|
|||
this.templateLicenses = this.fetchTemplateLicenses(this.template)
|
||||
this.templateProperties = this.fetchTemplateProperties(this.template)
|
||||
this.selectedTemplateConfiguration = {}
|
||||
if (this.templateConfigurationExists) {
|
||||
this.selectedTemplateConfiguration = this.templateConfigurations[0]
|
||||
this.handleTemplateConfiguration()
|
||||
if ('templateConfiguration' in this.form.fieldsStore.fieldsMeta) {
|
||||
this.updateFieldValue('templateConfiguration', this.selectedTemplateConfiguration.id)
|
||||
setTimeout(() => {
|
||||
if (this.templateConfigurationExists) {
|
||||
this.selectedTemplateConfiguration = this.templateConfigurations[0]
|
||||
this.handleTemplateConfiguration()
|
||||
if ('templateConfiguration' in this.form.fieldsStore.fieldsMeta) {
|
||||
this.updateFieldValue('templateConfiguration', this.selectedTemplateConfiguration.id)
|
||||
}
|
||||
this.updateComputeOffering(null) // reset as existing selection may be incompatible
|
||||
}
|
||||
this.updateComputeOffering(null) // reset as existing selection may be incompatible
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
onSelectTemplateConfigurationId (value) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue