-
{{ $t('message.required.traffic.type') }}
+
+
+
+
+
+ {{ item }}
+
+
+
@@ -282,6 +300,7 @@ export default {
addingTrafficForKey: '-1',
trafficLabelSelected: null,
showError: false,
+ errorList: [],
defaultTrafficOptions: [],
isChangeHyperv: false
}
@@ -298,7 +317,7 @@ export default {
columns.push({
title: this.$t('label.isolation.method'),
dataIndex: 'isolationMethod',
- width: 150,
+ width: 125,
slots: { customRender: 'isolationMethod' }
})
columns.push({
@@ -308,6 +327,13 @@ export default {
width: 250,
slots: { customRender: 'traffics' }
})
+ columns.push({
+ title: this.$t('label.tags'),
+ key: 'tags',
+ dataIndex: 'tags',
+ width: 175,
+ slots: { customRender: 'tags' }
+ })
if (this.isAdvancedZone) {
columns.push({
title: '',
@@ -399,7 +425,7 @@ export default {
return { type: item, label: '' }
})
this.count = 1
- this.physicalNetworks = [{ key: this.randomKeyTraffic(this.count), name: 'Physical Network 1', isolationMethod: 'VLAN', traffics: traffics }]
+ this.physicalNetworks = [{ key: this.randomKeyTraffic(this.count), name: 'Physical Network 1', isolationMethod: 'VLAN', traffics: traffics, tags: null }]
}
if (this.isAdvancedZone) {
this.availableTrafficToAdd.push('guest')
@@ -440,28 +466,32 @@ export default {
key: this.randomKeyTraffic(count + 1),
name: `Physical Network ${count + 1}`,
isolationMethod: 'VLAN',
- traffics: []
+ traffics: [],
+ tags: null
}
this.physicalNetworks = [...physicalNetworks, newData]
this.count = count + 1
this.hasUnusedPhysicalNetwork = this.getHasUnusedPhysicalNetwork()
},
isValidSetup () {
+ this.errorList = []
let physicalNetworks = this.physicalNetworks
if (this.tungstenNetworkIndex > -1) {
physicalNetworks = [this.physicalNetworks[this.tungstenNetworkIndex]]
}
const shouldHaveLabels = physicalNetworks.length > 1
let isValid = true
+ let countPhysicalNetworkWithoutTags = 0
this.requiredTrafficTypes.forEach(type => {
- if (!isValid) return false
let foundType = false
physicalNetworks.forEach(net => {
net.traffics.forEach(traffic => {
- if (!isValid) return false
if (traffic.type === type) {
foundType = true
}
+ if (traffic.type === 'guest' && type === 'guest' && (!net.tags || net.tags.length === 0)) {
+ countPhysicalNetworkWithoutTags++
+ }
if (this.hypervisor !== 'VMware') {
if (shouldHaveLabels && (!traffic.label || traffic.label.length === 0)) {
isValid = false
@@ -475,8 +505,15 @@ export default {
})
if (!foundType || !isValid) {
isValid = false
+ if (this.errorList.indexOf(this.$t('message.required.traffic.type')) === -1) {
+ this.errorList.push(this.$t('message.required.traffic.type'))
+ }
}
})
+ if (countPhysicalNetworkWithoutTags > 1) {
+ this.errorList.push(this.$t('message.required.tagged.physical.network'))
+ isValid = false
+ }
return isValid
},
handleSubmit (e) {