@@ -130,6 +130,7 @@ import OsLogo from '@/components/widgets/OsLogo'
130130import OsBasedImageSelectionSearchView from ' @views/compute/wizard/OsBasedImageSelectionSearchView'
131131import OsBasedImageRadioGroup from ' @views/compute/wizard/OsBasedImageRadioGroup'
132132import DiskSizeSelection from ' @views/compute/wizard/DiskSizeSelection'
133+ import { getEffectiveImageHypervisor } from ' @/utils/imageSelection'
133134
134135export default {
135136 name: ' OsBasedImageSelection' ,
@@ -234,6 +235,19 @@ export default {
234235 watch: {
235236 selectedImageType (newValue ) {
236237 this .localSelectedImageType = newValue
238+ this .emitEffectiveHypervisor (newValue, this .selectedImageId )
239+ },
240+ imageItems () {
241+ this .emitEffectiveHypervisor (
242+ this .localSelectedImageType ,
243+ this .selectedImageId
244+ )
245+ },
246+ ' preFillContent.hypervisor' () {
247+ this .emitEffectiveHypervisor (
248+ this .localSelectedImageType ,
249+ this .selectedImageId
250+ )
237251 },
238252 guestOsCategories (newValue ) {
239253 this .imageSearchFilters = {}
@@ -285,9 +299,26 @@ export default {
285299 this .localSelectedGuestOsCategoryId = value
286300 this .$emit (' change-guest-os-category' , this .localSelectedGuestOsCategoryId )
287301 },
302+ emitEffectiveHypervisor (imageType , imageId ) {
303+ const fallbackHypervisor = this .preFillContent ? .hypervisor
304+ if (! fallbackHypervisor) {
305+ return
306+ }
307+ this .$emit (
308+ ' update-image' ,
309+ ' hypervisor' ,
310+ getEffectiveImageHypervisor (
311+ this .imageItems ,
312+ imageType,
313+ imageId,
314+ fallbackHypervisor
315+ )
316+ )
317+ },
288318 updateImage (decorator , id ) {
289319 this .selectedImageId = id
290320 this .$emit (' update-image' , decorator, id)
321+ this .emitEffectiveHypervisor (decorator, id)
291322 },
292323 handleImageSearch (searchFilters ) {
293324 this .imageSearchFilters = {
0 commit comments