Skip to content

Commit d8bd9de

Browse files
committed
ui: fix console error
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent c6dab62 commit d8bd9de

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

ui/src/views/compute/DeployVM.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
:key="templateKey"
166166
@handle-search-filter="filters => fetchAllTemplates(filters)"
167167
@update-template-iso="updateFieldValue" />
168-
<div v-if="template.hypervisor !== 'External'">
168+
<div v-if="!isTemplateHypervisorExternal">
169169
{{ $t('label.override.rootdisk.size') }}
170170
<a-switch
171171
v-model:checked="form.rootdisksizeitem"
@@ -291,7 +291,7 @@
291291
<a-input v-model:value="form.memory"/>
292292
</a-form-item>
293293
</span>
294-
<span v-if="imageType!=='isoid' && template.hypervisor !== 'External'">
294+
<span v-if="imageType!=='isoid' && !isTemplateHypervisorExternal">
295295
{{ $t('label.override.root.diskoffering') }}
296296
<a-switch
297297
v-model:checked="showOverrideDiskOfferingOption"
@@ -370,10 +370,10 @@
370370
<a-step
371371
v-else
372372
:title="imageType === 'templateid' ? $t('label.data.disk') : $t('label.disk.size')"
373-
:disabled="template.hypervisor === 'External' ? true : false"
373+
:disabled="isTemplateHypervisorExternal ? true : false"
374374
:status="zoneSelected ? 'process' : 'wait'">
375375
<template #description>
376-
<div v-if="zoneSelected && template.hypervisor !== 'External'">
376+
<div v-if="zoneSelected && !isTemplateHypervisorExternal">
377377
<disk-offering-selection
378378
:items="options.diskOfferings"
379379
:row-count="rowCount.diskOfferings"
@@ -399,7 +399,7 @@
399399
<a-input v-model:value="form.size"/>
400400
</a-form-item>
401401
</div>
402-
<div v-else-if="template.hypervisor === 'External'" style="margin-bottom: 20px; margin-top: 7px">
402+
<div v-else-if="isTemplateHypervisorExternal" style="margin-bottom: 20px; margin-top: 7px">
403403
{{ $t('message.host.external.datadisk') }}
404404
</div>
405405
</template>
@@ -575,7 +575,7 @@
575575
ref="bootintosetup">
576576
<a-switch v-model:checked="form.bootintosetup" />
577577
</a-form-item>
578-
<a-form-item name="dynamicscalingenabled" ref="dynamicscalingenabled" v-if="template.hypervisor !== 'External'">
578+
<a-form-item name="dynamicscalingenabled" ref="dynamicscalingenabled" v-if="!!template && !isTemplateHypervisorExternal">
579579
<template #label>
580580
<tooltip-label :title="$t('label.dynamicscalingenabled')" :tooltip="$t('label.dynamicscalingenabled.tooltip')"/>
581581
</template>
@@ -815,7 +815,7 @@
815815
:filterOption="filterOption"
816816
></a-select>
817817
</a-form-item>
818-
<a-form-item name="externaldetails" ref="externaldetails" v-if="imageType === 'templateid' && template.hypervisor === 'External'">
818+
<a-form-item name="externaldetails" ref="externaldetails" v-if="imageType === 'templateid' && isTemplateHypervisorExternal">
819819
<template #label>
820820
<tooltip-label :title="$t('label.externaldetails')" :tooltip="apiParams.externaldetails.description" />
821821
</template>
@@ -1489,6 +1489,9 @@ export default {
14891489
},
14901490
guestOsCategoriesSelectionDisallowed () {
14911491
return (!this.queryGuestOsCategoryId || this.options.guestOsCategories.length === 0) && (!!this.queryTemplateId || !!this.queryIsoId)
1492+
},
1493+
isTemplateHypervisorExternal () {
1494+
return !!this.template && this.template.hypervisor === 'External'
14921495
}
14931496
},
14941497
watch: {
@@ -2376,7 +2379,7 @@ export default {
23762379
deployVmData.projectid = this.owner.projectid
23772380
}
23782381
2379-
if (this.imageType === 'templateid' && this.template === 'External' && values.externaldetails) {
2382+
if (this.imageType === 'templateid' && this.template && this.template.hypervisor === 'External' && values.externaldetails) {
23802383
Object.entries(values.externaldetails).forEach(([key, value]) => {
23812384
deployVmData['externaldetails[0].' + key] = value
23822385
})

0 commit comments

Comments
 (0)