|
133 | 133 | </a-tag> |
134 | 134 | </div> |
135 | 135 | </template> |
| 136 | + <template #tags="{ text, record, index }"> |
| 137 | + <a-input |
| 138 | + :disabled="tungstenNetworkIndex > -1 && tungstenNetworkIndex !== index" |
| 139 | + :value="text" |
| 140 | + @change="e => onCellChange(record.key, 'tags', e.target.value)" |
| 141 | + /> |
| 142 | + </template> |
136 | 143 | <template #actions="{ record, index }"> |
137 | 144 | <tooltip-button |
138 | 145 | :tooltip="$t('label.delete')" |
@@ -308,6 +315,13 @@ export default { |
308 | 315 | width: 250, |
309 | 316 | slots: { customRender: 'traffics' } |
310 | 317 | }) |
| 318 | + columns.push({ |
| 319 | + title: this.$t('label.tags'), |
| 320 | + key: 'tags', |
| 321 | + dataIndex: 'tags', |
| 322 | + width: 175, |
| 323 | + slots: { customRender: 'tags' } |
| 324 | + }) |
311 | 325 | if (this.isAdvancedZone) { |
312 | 326 | columns.push({ |
313 | 327 | title: '', |
@@ -456,12 +470,19 @@ export default { |
456 | 470 | this.requiredTrafficTypes.forEach(type => { |
457 | 471 | if (!isValid) return false |
458 | 472 | let foundType = false |
| 473 | + let countPhysicalNetworkWithoutTags = 0 |
459 | 474 | physicalNetworks.forEach(net => { |
460 | 475 | net.traffics.forEach(traffic => { |
461 | 476 | if (!isValid) return false |
462 | 477 | if (traffic.type === type) { |
463 | 478 | foundType = true |
464 | 479 | } |
| 480 | + if (traffic.type === 'guest' && type === 'guest' && (net.tags === null || net.tags === '')) { |
| 481 | + countPhysicalNetworkWithoutTags++ |
| 482 | + } |
| 483 | + if (countPhysicalNetworkWithoutTags > 1) { |
| 484 | + isValid = false |
| 485 | + } |
465 | 486 | if (this.hypervisor !== 'VMware') { |
466 | 487 | if (shouldHaveLabels && (!traffic.label || traffic.label.length === 0)) { |
467 | 488 | isValid = false |
|
0 commit comments