-
-
-
-
-
- {{ opt.name || opt.description }} ({{ `${$t('label.cidr')}: ${opt.cidr}` }})
-
- {{ opt.name || opt.description }}
-
-
-
+
0) {
- deployVmData['nicnetworklist[' + j + '].nic'] = keys[j].replace('nic-', '')
- deployVmData['nicnetworklist[' + j + '].network'] = values.networkMap[keys[j]]
- }
+ if (this.nicToNetworkSelection && this.nicToNetworkSelection.length > 0) {
+ for (var j in this.nicToNetworkSelection) {
+ var nicNetwork = this.nicToNetworkSelection[j]
+ deployVmData['nicnetworklist[' + j + '].nic'] = nicNetwork.nic
+ deployVmData['nicnetworklist[' + j + '].network'] = nicNetwork.network
}
} else {
const arrNetwork = []
@@ -2067,6 +2047,17 @@ export default {
nics.sort(function (a, b) {
return a.InstanceID - b.InstanceID
})
+ if (this.options.networks && this.options.networks.length > 0) {
+ this.nicToNetworkSelection = []
+ for (var i = 0; i < nics.length; ++i) {
+ var nic = nics[i]
+ nic.id = nic.InstanceID
+ var network = this.options.networks[Math.min(i, this.options.networks.length - 1)]
+ nic.selectednetworkid = network.id
+ nic.selectednetworkname = network.name
+ this.nicToNetworkSelection.push({ nic: nic.id, network: network.id })
+ }
+ }
}
return nics
},
@@ -2228,6 +2219,9 @@ export default {
onBootTypeChange (value) {
this.fetchBootModes(value)
this.updateFieldValue('bootmode', this.options.bootModes?.[0]?.id || undefined)
+ },
+ handleNicsNetworkSelection (nicToNetworkSelection) {
+ this.nicToNetworkSelection = nicToNetworkSelection
}
}
}