Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor enhancements
  • Loading branch information
sudo87 committed Jul 2, 2025
commit afd2b193b83c3c7f267e27f7781a4dbbe5112392
1 change: 1 addition & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3761,6 +3761,7 @@
"message.warn.change.primary.storage.scope": "This feature is tested and supported for the following configurations:<br>KVM - NFS/Ceph - DefaultPrimary<br>VMware - NFS - DefaultPrimary<br>*There might be extra steps involved to make it work for other configurations.",
"message.warn.filetype": "jpg, jpeg, png, bmp and svg are the only supported image formats.",
"message.warn.importing.instance.without.nic": "WARNING: This Instance is being imported without NICs and many Network resources will not be available. Consider creating a NIC via vCenter before importing or as soon as the Instance is imported.",
"message.warn.select.template": "Please select a Template for Registration.",
"message.warn.zone.mtu.update": "Please note that this limit won't affect pre-existing Network’s MTU settings",
"message.webhook.deliveries.time.filter": "Webhook deliveries list can be filtered based on date-time. Select 'Custom' for specifying start and end date range.",
"message.zone.creation.complete": "Zone creation complete.",
Expand Down
16 changes: 12 additions & 4 deletions ui/src/views/infra/zone/ZoneWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
<zone-wizard-register-template
v-else-if="zoneSteps[currentStep].name === 'registerTemplate'"
:zoneid="returnedZoneId"
:arch="selectedArch"
:zoneSuperType="selectedZoneSuperType"
@closeAction="onCloseAction"
@refresh-data="onRefreshData"
/>
Expand Down Expand Up @@ -177,7 +179,9 @@ export default {
}
],
zoneConfig: {},
returnedZoneId: null
returnedZoneId: null,
selectedArch: null,
selectedZoneSuperType: 'Core'
}
},
computed: {
Expand Down Expand Up @@ -222,11 +226,15 @@ export default {
data.zoneType !== this.zoneConfig.zoneType) {
this.zoneConfig.physicalNetworks = null
}

if (data.zoneReturned) {
if (data.zoneSuperType && data.zoneSuperType !== this.selectedZoneSuperType) {
this.selectedZoneSuperType = data.zoneSuperType
}
if (data.arch && data.arch !== this.selectedArch) {
this.selectedArch = data.arch
}
if (data.zoneReturned?.id) {
this.returnedZoneId = data.zoneReturned.id
}

this.zoneConfig = { ...this.zoneConfig, ...data }
},
onCloseAction () {
Expand Down
42 changes: 40 additions & 2 deletions ui/src/views/infra/zone/ZoneWizardRegisterTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@
<a-button class="button-back" @click="handleDone">{{ selectedRowKeys.length > 0 ? $t('label.done') : $t('label.skip') }}</a-button>
<a-button class="button-next" type="primary" @click="handleSubmit" ref="submit">{{ $t('label.register.template') }}</a-button>
</div>

<a-modal
:visible="showAlert"
:footer="null"
style="top: 20px;"
centered
width="auto"
@cancel="showAlert = false"
>
<template #title>
{{ $t('label.warning') }}
</template>
<a-alert type="warning">
<template #message>
<span v-html="$t('message.warn.select.template')" />
</template>
</a-alert>
<a-divider style="margin-top: 0;"></a-divider>
</a-modal>
</div>
</template>

Expand All @@ -57,6 +76,14 @@ export default {
zoneid: {
type: String,
required: false
},
arch: {
type: String,
required: false
},
zoneSuperType: {
type: String,
required: false
}
},
data: () => ({
Expand All @@ -66,7 +93,8 @@ export default {
rowKey: 0,
selectedRowKeys: [],
defaultOsTypeId: null,
deployedTemplates: {}
deployedTemplates: {},
showAlert: false
}),
created () {
this.initForm()
Expand Down Expand Up @@ -132,6 +160,9 @@ export default {
ostypeid: await this.fetchOsTypeId(templateData.name),
zoneid: this.zoneid
}
if (this.zoneSuperType === 'Edge') {
params.directdownload = true
}
return new Promise((resolve, reject) => {
api('registerTemplate', params).then(json => {
const result = json.registertemplateresponse.template[0]
Expand All @@ -144,6 +175,10 @@ export default {
},
async stepRegisterTemplates () {
const templatesToRegister = this.predefinedTemplates.filter(template => this.selectedRowKeys.includes(template.id) && this.deployedTemplates[template.id] !== true)
if (templatesToRegister.length === 0) {
this.showAlert = true
return
}
const registrationResults = []
for (const templateData of templatesToRegister) {
const promise = this.registerTemplate(templateData)
Expand Down Expand Up @@ -223,7 +258,10 @@ export default {
if (!response.ok) {
throw new Error(`Error fetching predefined templates, status_code: ${response.status}`)
}
this.predefinedTemplates = await response.json()
const templates = await response.json()
this.predefinedTemplates = this.arch
? templates.filter(template => template.arch === this.arch)
: templates
} catch (error) {
console.error('Error fetching predefined templates:', error)
this.predefinedTemplates = []
Expand Down
Loading