Skip to content

Commit 6f7655d

Browse files
committed
Registration template step in ZoneWizard for populating generic templates
1 parent 7632814 commit 6f7655d

File tree

4 files changed

+375
-4
lines changed

4 files changed

+375
-4
lines changed

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,7 @@
10101010
"label.filter.annotations.self": "Created by me",
10111011
"label.filterby": "Filter by",
10121012
"label.fingerprint": "FingerPrint",
1013+
"label.skip": "Skip",
10131014
"label.finish": "Finish",
10141015
"label.firewall": "Firewall",
10151016
"label.firewall.policy": "Firewall Policy",

ui/src/views/infra/zone/ZoneWizard.vue

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@
7474
:prefillContent="zoneConfig"
7575
/>
7676
<zone-wizard-launch-zone
77-
v-else
77+
v-else-if="zoneSteps[currentStep].name === 'launch'"
7878
@backPressed="backPressed"
79+
@nextPressed="nextPressed"
80+
@fieldsChanged="onFieldsChanged"
7981
@closeAction="onCloseAction"
8082
@refresh-data="onRefreshData"
8183
@stepError="onStepError"
@@ -85,6 +87,13 @@
8587
:isFixError="stepFixError"
8688
:prefillContent="zoneConfig"
8789
/>
90+
91+
<zone-wizard-register-template
92+
v-else-if="zoneSteps[currentStep].name === 'registerTemplate'"
93+
:zoneid="returnedZoneId"
94+
@closeAction="onCloseAction"
95+
@refresh-data="onRefreshData"
96+
/>
8897
</div>
8998
</div>
9099
</template>
@@ -95,6 +104,7 @@ import ZoneWizardCoreZoneTypeStep from '@views/infra/zone/ZoneWizardCoreZoneType
95104
import ZoneWizardZoneDetailsStep from '@views/infra/zone/ZoneWizardZoneDetailsStep'
96105
import ZoneWizardNetworkSetupStep from '@views/infra/zone/ZoneWizardNetworkSetupStep'
97106
import ZoneWizardAddResources from '@views/infra/zone/ZoneWizardAddResources'
107+
import ZoneWizardRegisterTemplate from '@views/infra/zone/ZoneWizardRegisterTemplate'
98108
import ZoneWizardLaunchZone from '@views/infra/zone/ZoneWizardLaunchZone'
99109
100110
export default {
@@ -103,6 +113,7 @@ export default {
103113
ZoneWizardCoreZoneTypeStep,
104114
ZoneWizardZoneDetailsStep,
105115
ZoneWizardNetworkSetupStep,
116+
ZoneWizardRegisterTemplate,
106117
ZoneWizardAddResources,
107118
ZoneWizardLaunchZone
108119
},
@@ -114,6 +125,13 @@ export default {
114125
launchZone: false,
115126
launchData: {},
116127
stepChild: '',
128+
registerTemplateStep: {
129+
name: 'registerTemplate',
130+
title: 'label.register.template',
131+
step: ['registerTemplateAction'],
132+
description: this.$t('message.desc.register.template'),
133+
hint: this.$t('message.hint.register.template')
134+
},
117135
coreZoneTypeStep: {
118136
name: 'coreType',
119137
title: 'label.core.zone.type',
@@ -158,7 +176,8 @@ export default {
158176
hint: this.$t('message.launch.zone.hint')
159177
}
160178
],
161-
zoneConfig: {}
179+
zoneConfig: {},
180+
returnedZoneId: null
162181
}
163182
},
164183
computed: {
@@ -167,6 +186,9 @@ export default {
167186
if (this.zoneConfig.zoneSuperType !== 'Edge') {
168187
steps.splice(1, 0, this.coreZoneTypeStep)
169188
}
189+
if (this.zoneConfig.hypervisor === 'KVM') {
190+
steps.splice(steps.length, 0, this.registerTemplateStep)
191+
}
170192
return steps
171193
}
172194
},
@@ -201,6 +223,10 @@ export default {
201223
this.zoneConfig.physicalNetworks = null
202224
}
203225
226+
if (data.zoneReturned) {
227+
this.returnedZoneId = data.zoneReturned.id
228+
}
229+
204230
this.zoneConfig = { ...this.zoneConfig, ...data }
205231
},
206232
onCloseAction () {

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,8 +1723,13 @@ export default {
17231723
await this.$message.success('Success')
17241724
this.loading = false
17251725
this.steps = []
1726-
this.$emit('closeAction')
1727-
this.$emit('refresh-data')
1726+
if (this.prefillContent.hypervisor === 'KVM') {
1727+
this.$emit('fieldsChanged', { zoneReturned: { id: this.stepData.zoneReturned.id } })
1728+
this.$emit('nextPressed')
1729+
} else {
1730+
this.$emit('closeAction')
1731+
this.$emit('refresh-data')
1732+
}
17281733
} catch (e) {
17291734
this.loading = false
17301735
await this.$notification.error({

0 commit comments

Comments
 (0)