diff --git a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue index a5a39d59116..d68c937dd4e 100644 --- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue @@ -150,7 +150,7 @@ > {{ $t('message.edit.traffic.type') }} - + + + + + + + + + + + {{ $t('label.vswitch.type.nexusdvs') }} + {{ $t('label.vswitch.type.vmwaresvs') }} + {{ $t('label.vswitch.type.vmwaredvs') }} + + + @@ -209,7 +224,8 @@ export default { addingTrafficForKey: '-1', trafficLabelSelected: null, showError: false, - defaultTrafficOptions: [] + defaultTrafficOptions: [], + isChangeHyperv: false } }, computed: { @@ -270,6 +286,9 @@ export default { traffics.push('public') } return traffics + }, + hypervisor () { + return this.prefillContent.hypervisor?.value || null } }, beforeCreate () { @@ -287,8 +306,13 @@ export default { this.count = this.physicalNetworks.length requiredTrafficTypes.forEach(type => { let foundType = false - this.physicalNetworks.forEach(net => { + this.physicalNetworks.forEach((net, idx) => { for (const index in net.traffics) { + if (this.hypervisor === 'VMware') { + delete this.physicalNetworks[idx].traffics[index].label + } else { + this.physicalNetworks[idx].traffics[index].label = '' + } const traffic = net.traffics[index] if (traffic.type === 'storage') { const idx = this.availableTrafficToAdd.indexOf(traffic.type) @@ -410,8 +434,25 @@ export default { traffic: traffic } this.showEditTraffic = true - this.form.setFieldsValue({ - trafficLabel: this.trafficInEdit !== null ? this.trafficInEdit.traffic.label : null + const fields = {} + if (this.hypervisor === 'VMware') { + delete this.trafficInEdit.traffic.label + fields.vSwitchName = null + fields.vlanId = null + if (traffic.type === 'guest') { + fields.vSwitchName = this.trafficInEdit?.traffic?.vSwitchName || 'vSwitch0' + } + fields.vSwitchType = 'vmwaresvs' + } else { + delete this.trafficInEdit.traffic.vSwitchName + delete this.trafficInEdit.traffic.vlanId + delete this.trafficInEdit.traffic.vSwitchType + fields.trafficLabel = null + fields.trafficLabel = this.trafficInEdit?.traffic?.label || null + } + + Object.keys(fields).forEach(key => { + this.form.getFieldDecorator([key], { initialValue: fields[key] }) }) }, deleteTraffic (key, traffic, $event) { @@ -429,7 +470,15 @@ export default { this.form.validateFields((err, values) => { if (!err) { this.showEditTraffic = false - trafficInEdit.traffic.label = values.trafficLabel + if (this.hypervisor === 'VMware') { + trafficInEdit.traffic.vSwitchName = values.vSwitchName + trafficInEdit.traffic.vlanId = values.vlanId + if (this.isAdvancedZone) { + trafficInEdit.traffic.vSwitchType = values.vSwitchType + } + } else { + trafficInEdit.traffic.label = values.trafficLabel + } this.trafficInEdit = null } })