diff --git a/ui/src/components/view/ResourceView.vue b/ui/src/components/view/ResourceView.vue index 582dfc4fae3..2147f0bc2cc 100644 --- a/ui/src/components/view/ResourceView.vue +++ b/ui/src/components/view/ResourceView.vue @@ -120,9 +120,18 @@ export default { if (this.resource && this.resource.virtualmachineid && this.resource.vpcid) { return false } - if (this.resource && this.resource.vpcid && tab.name !== 'firewall') { + // dont display any option for source NAT IP of VPC + if (this.resource && this.resource.vpcid && !this.resource.issourcenat && tab.name !== 'firewall') { return true } + // display LB and PF options for isolated networks if static nat is disabled + if (this.resource && !this.resource.vpcid) { + if (!this.resource.isstaticnat) { + return true + } else if (tab.name === 'firewall') { + return true + } + } return this.networkService && this.networkService.service && tab.networkServiceFilter(this.networkService.service) } else if ('show' in tab) { diff --git a/ui/src/views/network/PublicIpResource.vue b/ui/src/views/network/PublicIpResource.vue index 0831f181815..84c62eb4c45 100644 --- a/ui/src/views/network/PublicIpResource.vue +++ b/ui/src/views/network/PublicIpResource.vue @@ -99,13 +99,18 @@ export default { this.loading = true this.portFWRuleCount = await this.fetchPortFWRule() - if (this.portFWRuleCount > 0) { + // disable load balancing rules only if port forwarding is enabled and + // network belongs to VPC + if (this.portFWRuleCount > 0 && this.resource.vpcid) { this.tabs = this.$route.meta.tabs.filter(tab => tab.name !== 'loadbalancing') } else { this.loadBalancerRuleCount = await this.fetchLoadBalancerRule() + // for isolated networks, display both LB and PF + // for VPC they are mutually exclusive if (this.loadBalancerRuleCount > 0) { - this.tabs = this.$route.meta.tabs.filter(tab => tab.name !== 'portforwarding') + this.tabs = + this.resource.vpcid ? this.$route.meta.tabs.filter(tab => tab.name !== 'portforwarding') : this.$route.meta.tabs this.loading = false } else { this.tabs = this.$route.meta.tabs