Skip to content

Commit 1022c61

Browse files
UI fix
1 parent f1f0cd0 commit 1022c61

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
474474
final Map<Service, Set<Provider>> svcProviderMap = new HashMap<>();
475475
final Set<Provider> defaultProviders = Set.of(Provider.Netris);
476476
for (final Service svc : getSupportedServices()) {
477-
if (List.of(Service.UserData, Service.Dhcp, Service.Dns).contains(svc)) {
477+
if (List.of(Service.UserData, Service.Dhcp, Service.Dns, Service.Firewall).contains(svc)) {
478478
final Set<Provider> userDataProvider = Set.of(Provider.VPCVirtualRouter);
479479
svcProviderMap.put(svc, userDataProvider);
480480
} else if (List.of(Service.SourceNat, Service.NetworkACL).contains(svc)){

ui/src/views/network/PublicIpResource.vue

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)