|
165 | 165 | :key="templateKey" |
166 | 166 | @handle-search-filter="filters => fetchAllTemplates(filters)" |
167 | 167 | @update-template-iso="updateFieldValue" /> |
168 | | - <div v-if="template.hypervisor !== 'External'"> |
| 168 | + <div v-if="!isTemplateHypervisorExternal"> |
169 | 169 | {{ $t('label.override.rootdisk.size') }} |
170 | 170 | <a-switch |
171 | 171 | v-model:checked="form.rootdisksizeitem" |
|
291 | 291 | <a-input v-model:value="form.memory"/> |
292 | 292 | </a-form-item> |
293 | 293 | </span> |
294 | | - <span v-if="imageType!=='isoid' && template.hypervisor !== 'External'"> |
| 294 | + <span v-if="imageType!=='isoid' && !isTemplateHypervisorExternal"> |
295 | 295 | {{ $t('label.override.root.diskoffering') }} |
296 | 296 | <a-switch |
297 | 297 | v-model:checked="showOverrideDiskOfferingOption" |
|
370 | 370 | <a-step |
371 | 371 | v-else |
372 | 372 | :title="imageType === 'templateid' ? $t('label.data.disk') : $t('label.disk.size')" |
373 | | - :disabled="template.hypervisor === 'External' ? true : false" |
| 373 | + :disabled="isTemplateHypervisorExternal ? true : false" |
374 | 374 | :status="zoneSelected ? 'process' : 'wait'"> |
375 | 375 | <template #description> |
376 | | - <div v-if="zoneSelected && template.hypervisor !== 'External'"> |
| 376 | + <div v-if="zoneSelected && !isTemplateHypervisorExternal"> |
377 | 377 | <disk-offering-selection |
378 | 378 | :items="options.diskOfferings" |
379 | 379 | :row-count="rowCount.diskOfferings" |
|
399 | 399 | <a-input v-model:value="form.size"/> |
400 | 400 | </a-form-item> |
401 | 401 | </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"> |
403 | 403 | {{ $t('message.host.external.datadisk') }} |
404 | 404 | </div> |
405 | 405 | </template> |
|
575 | 575 | ref="bootintosetup"> |
576 | 576 | <a-switch v-model:checked="form.bootintosetup" /> |
577 | 577 | </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"> |
579 | 579 | <template #label> |
580 | 580 | <tooltip-label :title="$t('label.dynamicscalingenabled')" :tooltip="$t('label.dynamicscalingenabled.tooltip')"/> |
581 | 581 | </template> |
|
815 | 815 | :filterOption="filterOption" |
816 | 816 | ></a-select> |
817 | 817 | </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"> |
819 | 819 | <template #label> |
820 | 820 | <tooltip-label :title="$t('label.externaldetails')" :tooltip="apiParams.externaldetails.description" /> |
821 | 821 | </template> |
@@ -1489,6 +1489,9 @@ export default { |
1489 | 1489 | }, |
1490 | 1490 | guestOsCategoriesSelectionDisallowed () { |
1491 | 1491 | return (!this.queryGuestOsCategoryId || this.options.guestOsCategories.length === 0) && (!!this.queryTemplateId || !!this.queryIsoId) |
| 1492 | + }, |
| 1493 | + isTemplateHypervisorExternal () { |
| 1494 | + return !!this.template && this.template.hypervisor === 'External' |
1492 | 1495 | } |
1493 | 1496 | }, |
1494 | 1497 | watch: { |
@@ -2376,7 +2379,7 @@ export default { |
2376 | 2379 | deployVmData.projectid = this.owner.projectid |
2377 | 2380 | } |
2378 | 2381 |
|
2379 | | - if (this.imageType === 'templateid' && this.template === 'External' && values.externaldetails) { |
| 2382 | + if (this.imageType === 'templateid' && this.template && this.template.hypervisor === 'External' && values.externaldetails) { |
2380 | 2383 | Object.entries(values.externaldetails).forEach(([key, value]) => { |
2381 | 2384 | deployVmData['externaldetails[0].' + key] = value |
2382 | 2385 | }) |
|
0 commit comments