|
279 | 279 | <a-card |
280 | 280 | v-else |
281 | 281 | :tabList="tabList" |
282 | | - :activeTabKey="tabKey" |
283 | | - @tabChange="key => onTabChange(key, 'tabKey')"> |
284 | | - <div v-if="tabKey === 'templateid'"> |
| 282 | + :activeTabKey="form.imagetype" |
| 283 | + @tabChange="key => changeImageType(key)"> |
| 284 | + <div v-if="form.imagetype === 'templateid'"> |
285 | 285 | {{ $t('message.template.desc') }} |
286 | 286 | <new-template-iso-selection |
287 | 287 | v-if="templateview === 'new'" |
288 | 288 | input-decorator="templateid" |
289 | 289 | :items="options.templates" |
290 | | - :selected="tabKey" |
| 290 | + :selected="form.imagetype" |
291 | 291 | :loading="loading.templates" |
292 | 292 | :preFillContent="dataPreFill" |
293 | 293 | @handle-search-filter="($event) => fetchAllTemplates($event)" |
|
296 | 296 | v-else |
297 | 297 | input-decorator="templateid" |
298 | 298 | :items="options.templates" |
299 | | - :selected="tabKey" |
| 299 | + :selected="form.imagetype" |
300 | 300 | :loading="loading.templates" |
301 | 301 | :preFillContent="dataPreFill" |
302 | 302 | :key="templateKey" |
|
338 | 338 | v-if="templateview === 'new'" |
339 | 339 | input-decorator="isoid" |
340 | 340 | :items="options.isos" |
341 | | - :selected="tabKey" |
| 341 | + :selected="form.imagetype" |
342 | 342 | :loading="loading.isos" |
343 | 343 | :preFillContent="dataPreFill" |
344 | 344 | @handle-search-filter="($event) => fetchAllIsos($event)" |
|
347 | 347 | v-else |
348 | 348 | input-decorator="isoid" |
349 | 349 | :items="options.isos" |
350 | | - :selected="tabKey" |
| 350 | + :selected="form.imagetype" |
351 | 351 | :loading="loading.isos" |
352 | 352 | :preFillContent="dataPreFill" |
353 | 353 | @handle-search-filter="($event) => fetchAllIsos($event)" |
|
450 | 450 | <a-input v-model:value="form.memory"/> |
451 | 451 | </a-form-item> |
452 | 452 | </span> |
453 | | - <span v-if="tabKey!=='isoid'"> |
| 453 | + <span v-if="form.imagetype!=='isoid'"> |
454 | 454 | {{ $t('label.override.root.diskoffering') }} |
455 | 455 | <a-switch |
456 | 456 | v-model:checked="showOverrideDiskOfferingOption" |
|
459 | 459 | @change="val => { updateOverrideRootDiskShowParam(val) }" |
460 | 460 | style="margin-left: 10px;"/> |
461 | 461 | </span> |
462 | | - <span v-if="tabKey!=='isoid' && serviceOffering && !serviceOffering.diskofferingstrictness"> |
| 462 | + <span v-if="form.imagetype!=='isoid' && serviceOffering && !serviceOffering.diskofferingstrictness"> |
463 | 463 | <a-step |
464 | 464 | :status="zoneSelected ? 'process' : 'wait'" |
465 | 465 | v-if="!template.deployasis && template.childtemplates && template.childtemplates.length > 0" > |
|
486 | 486 | :value="overrideDiskOffering ? overrideDiskOffering.id : ''" |
487 | 487 | :loading="loading.diskOfferings" |
488 | 488 | :preFillContent="dataPreFill" |
489 | | - :isIsoSelected="tabKey==='isoid'" |
| 489 | + :isIsoSelected="form.imagetype==='isoid'" |
490 | 490 | :isRootDiskOffering="true" |
491 | 491 | @on-selected-root-disk-size="onSelectRootDiskSize" |
492 | 492 | @select-disk-offering-item="($event) => updateOverrideDiskOffering($event)" |
|
528 | 528 | </a-step> |
529 | 529 | <a-step |
530 | 530 | v-else |
531 | | - :title="tabKey === 'templateid' ? $t('label.data.disk') : $t('label.disk.size')" |
| 531 | + :title="form.imagetype === 'templateid' ? $t('label.data.disk') : $t('label.disk.size')" |
532 | 532 | :status="zoneSelected ? 'process' : 'wait'"> |
533 | 533 | <template #description> |
534 | 534 | <div v-if="zoneSelected"> |
|
539 | 539 | :value="diskOffering ? diskOffering.id : ''" |
540 | 540 | :loading="loading.diskOfferings" |
541 | 541 | :preFillContent="dataPreFill" |
542 | | - :isIsoSelected="tabKey==='isoid'" |
| 542 | + :isIsoSelected="form.imagetype==='isoid'" |
543 | 543 | @on-selected-disk-size="onSelectDiskSize" |
544 | 544 | @select-disk-offering-item="($event) => updateDiskOffering($event)" |
545 | 545 | @handle-search-filter="($event) => handleSearchFilter('diskOfferings', $event)" |
|
725 | 725 | </div> |
726 | 726 | <a-form-item |
727 | 727 | :label="$t('label.bootintosetup')" |
728 | | - v-if="zoneSelected && ((tabKey === 'isoid' && hypervisor === 'VMware') || (tabKey === 'templateid' && template && template.hypervisor === 'VMware'))" |
| 728 | + v-if="zoneSelected && ((form.imagetype === 'isoid' && hypervisor === 'VMware') || (form.imagetype === 'templateid' && template && template.hypervisor === 'VMware'))" |
729 | 729 | name="bootintosetup" |
730 | 730 | ref="bootintosetup"> |
731 | 731 | <a-switch v-model:checked="form.bootintosetup" /> |
@@ -1224,7 +1224,6 @@ export default { |
1224 | 1224 | defaultnetworkid: '', |
1225 | 1225 | networkConfig: [], |
1226 | 1226 | dataNetworkCreated: [], |
1227 | | - tabKey: 'templateid', |
1228 | 1227 | userdataTabKey: 'userdataregistered', |
1229 | 1228 | dataPreFill: {}, |
1230 | 1229 | showDetails: false, |
@@ -2004,7 +2003,7 @@ export default { |
2004 | 2003 | }, |
2005 | 2004 | updateFieldValue (name, value) { |
2006 | 2005 | if (name === 'templateid') { |
2007 | | - this.tabKey = 'templateid' |
| 2006 | + this.form.imagetype = 'templateid' |
2008 | 2007 | this.form.templateid = value |
2009 | 2008 | this.form.isoid = null |
2010 | 2009 | this.resetFromTemplateConfiguration() |
@@ -2047,7 +2046,7 @@ export default { |
2047 | 2046 | this.templateNics = [] |
2048 | 2047 | this.templateLicenses = [] |
2049 | 2048 | this.templateProperties = {} |
2050 | | - this.tabKey = 'isoid' |
| 2049 | + this.form.imagetype = 'isoid' |
2051 | 2050 | this.resetFromTemplateConfiguration() |
2052 | 2051 | this.form.isoid = value |
2053 | 2052 | this.form.templateid = null |
@@ -2185,15 +2184,18 @@ export default { |
2185 | 2184 | this.fetchGuestOsCategories() |
2186 | 2185 | return |
2187 | 2186 | } |
2188 | | - if (this.tabKey === 'templateid') { |
| 2187 | + if (this.form.imagetype === 'templateid') { |
2189 | 2188 | this.fetchAllTemplates() |
2190 | 2189 | } else { |
2191 | 2190 | this.fetchAllIsos() |
2192 | 2191 | } |
2193 | 2192 | }, |
2194 | | - changeImageType () { |
| 2193 | + changeImageType (imageType) { |
2195 | 2194 | if (this.templateview === 'new') { |
2196 | 2195 | this.fetchGuestOsCategories() |
| 2196 | + } else { |
| 2197 | + this.form.imagetype = imageType |
| 2198 | + this.fetchImages() |
2197 | 2199 | } |
2198 | 2200 | }, |
2199 | 2201 | handleSubmitAndStay (e) { |
@@ -2259,7 +2261,7 @@ export default { |
2259 | 2261 | deployVmData.userdata = this.$toBase64AndURIEncoded(values.userdata) |
2260 | 2262 | } |
2261 | 2263 | // step 2: select template/iso |
2262 | | - if (this.tabKey === 'templateid') { |
| 2264 | + if (this.form.imagetype === 'templateid') { |
2263 | 2265 | deployVmData.templateid = values.templateid |
2264 | 2266 | values.hypervisor = null |
2265 | 2267 | } else { |
@@ -2673,8 +2675,7 @@ export default { |
2673 | 2675 | }) |
2674 | 2676 | }, |
2675 | 2677 | fetchImages (params) { |
2676 | | - const key = this.templateview === 'new' ? this.form.imagetype : this.tabKey |
2677 | | - if (key === 'isoid') { |
| 2678 | + if (this.form.imagetype === 'isoid') { |
2678 | 2679 | this.fetchAllIsos(params) |
2679 | 2680 | return |
2680 | 2681 | } |
@@ -2785,10 +2786,7 @@ export default { |
2785 | 2786 | this.form.isoid = undefined |
2786 | 2787 | this.resetTemplatesList() |
2787 | 2788 | this.resetIsosList() |
2788 | | - this.tabKey = 'templateid' |
2789 | | - if (this.isoId) { |
2790 | | - this.tabKey = 'isoid' |
2791 | | - } |
| 2789 | + this.form.imagetype = this.isoId ? 'isoid' : 'templateid' |
2792 | 2790 | this.fetchZoneOptions() |
2793 | 2791 | }, |
2794 | 2792 | onSelectPodId (value) { |
@@ -2822,12 +2820,6 @@ export default { |
2822 | 2820 | this.params[name].options = { ...this.params[name].options, ...options } |
2823 | 2821 | this.fetchOptions(this.params[name], name) |
2824 | 2822 | }, |
2825 | | - onTabChange (key, type) { |
2826 | | - this[type] = key |
2827 | | - if (key === 'isoid') { |
2828 | | - this.fetchAllIsos() |
2829 | | - } |
2830 | | - }, |
2831 | 2823 | onUserdataTabChange (key, type) { |
2832 | 2824 | this[type] = key |
2833 | 2825 | this.userDataParams = [] |
|
0 commit comments