UI: Fix ISO Hypervisor selection (#11261)

This commit is contained in:
Vishesh 2025-07-23 13:07:02 +05:30 committed by GitHub
parent 9d049707d5
commit a710ff8c6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View File

@ -148,7 +148,7 @@
@handle-image-search-filter="filters => fetchImages(filters)" @handle-image-search-filter="filters => fetchImages(filters)"
@update-image="updateFieldValue" @update-image="updateFieldValue"
@update-disk-size="updateFieldValue" @update-disk-size="updateFieldValue"
@change-iso-hypervisor="value => hypervisor = value" /> @change-iso-hypervisor="value => form.hypervisor = value" />
<a-card <a-card
v-else v-else
:tabList="imageTypeList" :tabList="imageTypeList"

View File

@ -112,7 +112,7 @@
v-model:value="localSelectedIsoHypervisor" v-model:value="localSelectedIsoHypervisor"
:preFillContent="preFillContent" :preFillContent="preFillContent"
:options="isoHypervisorItems" :options="isoHypervisorItems"
@change="handleIsoHypervisorChange()" @change="handleIsoHypervisorChange"
showSearch showSearch
optionFilterProp="label" optionFilterProp="label"
:filterOption="filterOption" /> :filterOption="filterOption" />
@ -325,8 +325,8 @@ export default {
emitUpdateDiskSize (decorator, value) { emitUpdateDiskSize (decorator, value) {
this.$emit('update-disk-size', decorator, value) this.$emit('update-disk-size', decorator, value)
}, },
handleIsoHypervisorChange () { handleIsoHypervisorChange (hypervisor) {
this.$emit('change-iso-hypervisor', this.localIsoHypervisor) this.$emit('change-iso-hypervisor', hypervisor)
} }
} }
} }

View File

@ -63,7 +63,7 @@
</template> </template>
<script> <script>
import { api } from '@/api' import { getAPI, postAPI } from '@/api'
import { genericCompare } from '@/utils/sort.js' import { genericCompare } from '@/utils/sort.js'
import OsLogo from '@/components/widgets/OsLogo' import OsLogo from '@/components/widgets/OsLogo'
@ -164,7 +164,7 @@ export default {
params.directdownload = true params.directdownload = true
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
api('registerTemplate', params).then(json => { postAPI('registerTemplate', params).then(json => {
const result = json.registertemplateresponse.template[0] const result = json.registertemplateresponse.template[0]
resolve(result) resolve(result)
}).catch(error => { }).catch(error => {
@ -225,7 +225,7 @@ export default {
let osTypeId = this.defaultOsTypeId let osTypeId = this.defaultOsTypeId
this.loading = true this.loading = true
try { try {
const json = await api('listOsTypes', { keyword: osName, filter: 'name,id' }) const json = await getAPI('listOsTypes', { keyword: osName, filter: 'name,id' })
if (json && json.listostypesresponse && json.listostypesresponse.ostype && json.listostypesresponse.ostype.length > 0) { if (json && json.listostypesresponse && json.listostypesresponse.ostype && json.listostypesresponse.ostype.length > 0) {
osTypeId = json.listostypesresponse.ostype[0].id osTypeId = json.listostypesresponse.ostype[0].id
} }