@@ -1451,7 +1451,7 @@ export default {
14511451 this .initForm ()
14521452 this .dataPreFill = this .preFillContent && Object .keys (this .preFillContent ).length > 0 ? this .preFillContent : {}
14531453 this .showOverrideDiskOfferingOption = this .dataPreFill .overridediskoffering
1454-
1454+ this . selectedArchitecture = this . dataPreFill . backupArch ? this . dataPreFill . backupArch : this . architectureTypes . opts [ 0 ]. id
14551455 if (this .dataPreFill .isIso ) {
14561456 this .tabKey = ' isoid'
14571457 } else {
@@ -1540,46 +1540,6 @@ export default {
15401540 fillValue (field ) {
15411541 this .form [field] = this .dataPreFill [field]
15421542 },
1543- fetchZoneByQuery () {
1544- return new Promise (resolve => {
1545- let zones = []
1546- let apiName = ' '
1547- const params = {}
1548- if (this .templateId ) {
1549- apiName = ' listTemplates'
1550- params .listall = true
1551- params .templatefilter = this .isNormalAndDomainUser ? ' executable' : ' all'
1552- params .id = this .templateId
1553- } else if (this .isoId ) {
1554- apiName = ' listIsos'
1555- params .listall = true
1556- params .isofilter = this .isNormalAndDomainUser ? ' executable' : ' all'
1557- params .id = this .isoId
1558- } else if (this .networkId ) {
1559- params .listall = true
1560- params .id = this .networkId
1561- apiName = ' listNetworks'
1562- }
1563- if (! apiName) return resolve (zones)
1564-
1565- getAPI (apiName, params).then (json => {
1566- let objectName
1567- const responseName = [apiName .toLowerCase (), ' response' ].join (' ' )
1568- for (const key in json[responseName]) {
1569- if (key === ' count' ) {
1570- continue
1571- }
1572- objectName = key
1573- break
1574- }
1575- const data = json? .[responseName]? .[objectName] || []
1576- zones = data .map (item => item .zoneid )
1577- return resolve (zones)
1578- }).catch (() => {
1579- return resolve (zones)
1580- })
1581- })
1582- },
15831543 async fetchData () {
15841544 this .fetchZones (null , null )
15851545 _ .each (this .params , (param , name ) => {
@@ -1718,6 +1678,7 @@ export default {
17181678 if (template .details [' vmware-to-kvm-mac-addresses' ]) {
17191679 this .dataPreFill .macAddressArray = JSON .parse (template .details [' vmware-to-kvm-mac-addresses' ])
17201680 }
1681+ this .selectedArchitecture = template? .arch || ' x86_64'
17211682 }
17221683 } else if (name === ' isoid' ) {
17231684 this .templateConfigurations = []
@@ -2344,9 +2305,6 @@ export default {
23442305 this .clusterId = null
23452306 this .zone = _ .find (this .options .zones , (option ) => option .id === value)
23462307 this .isZoneSelectedMultiArch = this .zone .ismultiarch
2347- if (this .isZoneSelectedMultiArch ) {
2348- this .selectedArchitecture = this .architectureTypes .opts [0 ].id
2349- }
23502308 this .zoneSelected = true
23512309 this .form .startvm = true
23522310 this .selectedZone = this .zoneId
0 commit comments