@@ -135,24 +135,39 @@ export default {
135135 return
136136 }
137137 if (this .resource && this .resource .vpcid ) {
138- // VPC IPs with source nat have VPN and Firewall
138+ // VPC IPs with source nat have VPN and Firewall (firewall only if associatednetworkid present)
139139 if (this .resource .issourcenat ) {
140- this .tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => [' vpn' , ' firewall' ].includes (tab .name )))
140+ let tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => tab .name === ' vpn' ))
141+ if (this .resource .associatednetworkid ) {
142+ tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => [' vpn' , ' firewall' ].includes (tab .name )))
143+ }
144+ this .tabs = tabs
141145 return
142146 }
143147
144- // VPC IPs with static nat have firewall
148+ // VPC IPs with static nat have firewall (only if associatednetworkid present)
145149 if (this .resource .isstaticnat ) {
146150 if (this .resource .virtualmachinetype === ' DomainRouter' ) {
147- this .tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => [' vpn' , ' firewall' ].includes (tab .name )))
151+ let tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => tab .name === ' vpn' ))
152+ if (this .resource .associatednetworkid ) {
153+ tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => [' vpn' , ' firewall' ].includes (tab .name )))
154+ }
155+ this .tabs = tabs
148156 } else {
149- this .tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => tab .name === ' firewall' ))
157+ if (this .resource .associatednetworkid ) {
158+ this .tabs = this .defaultTabs .concat (this .$route .meta .tabs .filter (tab => tab .name === ' firewall' ))
159+ } else {
160+ this .tabs = this .defaultTabs
161+ }
150162 }
151163 return
152164 }
153165
154- // VPC IPs now have firewall support
166+ // VPC IPs have all tabs, but firewall only if associatednetworkid present
155167 let tabs = this .$route .meta .tabs
168+ if (! this .resource .associatednetworkid ) {
169+ tabs = tabs .filter (tab => tab .name !== ' firewall' )
170+ }
156171
157172 const network = await this .fetchNetwork ()
158173 if (network && network .networkofferingconservemode ) {
0 commit comments