Skip to content

Commit 4b1d016

Browse files
author
Jessica Wang
committed
CLOUDSTACK-4142: UI > IP Address page > configuration tab > filter - remove duplicate code.
1 parent 9ce20a3 commit 4b1d016

1 file changed

Lines changed: 1 addition & 62 deletions

File tree

‎ui/scripts/network.js‎

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -148,68 +148,7 @@
148148
item.issystem == true) {
149149
return [];
150150
}
151-
152-
if (item.networkOfferingConserveMode == false) {
153-
/*
154-
(1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer can be enabled/added.
155-
*/
156-
if (item.issourcenat == true) {
157-
disallowedActions.push('enableStaticNAT');
158-
disallowedActions.push('enableVPN');
159-
}
160-
161-
/*
162-
(2) If IP is non-SourceNat, show StaticNat/VPN/PortForwarding/LoadBalancer at first.
163-
1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
164-
2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
165-
3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
166-
4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
167-
*/
168-
else { //item.issourcenat == false
169-
if (item.isstaticnat) { //1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
170-
disallowedActions.push('enableVPN');
171-
}
172-
if (item.vpnenabled) { //2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
173-
disallowedActions.push('enableStaticNAT');
174-
}
175-
176-
//3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
177-
$.ajax({
178-
url: createURL('listPortForwardingRules'),
179-
data: {
180-
ipaddressid: item.id,
181-
listAll: true
182-
},
183-
dataType: 'json',
184-
async: false,
185-
success: function(json) {
186-
var rules = json.listportforwardingrulesresponse.portforwardingrule;
187-
if (rules != null && rules.length > 0) {
188-
disallowedActions.push('enableVPN');
189-
disallowedActions.push('enableStaticNAT');
190-
}
191-
}
192-
});
193-
194-
//4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
195-
$.ajax({
196-
url: createURL('listLoadBalancerRules'),
197-
data: {
198-
publicipid: item.id,
199-
listAll: true
200-
},
201-
dataType: 'json',
202-
async: false,
203-
success: function(json) {
204-
var rules = json.listloadbalancerrulesresponse.loadbalancerrule;
205-
if (rules != null && rules.length > 0) {
206-
disallowedActions.push('enableVPN');
207-
disallowedActions.push('enableStaticNAT');
208-
}
209-
}
210-
});
211-
}
212-
}
151+
213152
if (item.networkOfferingConserveMode == false) {
214153
/*
215154
(1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer can be enabled/added.

0 commit comments

Comments
 (0)