mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 19:14:40 +01:00
cloudstack UI - Static NAT, Port Forwarding and Firewall Implementation on JuniperSRX - IP Address page - configuration - if Firewall is provided by JuniperSRX, hide Firewall icon when Port forwarding is configured on IP Address.
This commit is contained in:
parent
a8e18f0529
commit
714b0593d3
@ -1822,6 +1822,8 @@
|
|||||||
var havingLbService = false;
|
var havingLbService = false;
|
||||||
var havingVpnService = false;
|
var havingVpnService = false;
|
||||||
|
|
||||||
|
var FirewallProviderArrayIncludesJuniperSRX = false;
|
||||||
|
|
||||||
if('networks' in args.context && args.context.networks[0].vpcid == null) { //a non-VPC network from Guest Network section
|
if('networks' in args.context && args.context.networks[0].vpcid == null) { //a non-VPC network from Guest Network section
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listNetworkOfferings'),
|
url: createURL('listNetworkOfferings'),
|
||||||
@ -1834,14 +1836,25 @@
|
|||||||
var networkoffering = json.listnetworkofferingsresponse.networkoffering[0];
|
var networkoffering = json.listnetworkofferingsresponse.networkoffering[0];
|
||||||
$(networkoffering.service).each(function(){
|
$(networkoffering.service).each(function(){
|
||||||
var thisService = this;
|
var thisService = this;
|
||||||
if(thisService.name == "Firewall")
|
if(thisService.name == "Firewall") {
|
||||||
havingFirewallService = true;
|
havingFirewallService = true;
|
||||||
if(thisService.name == "PortForwarding")
|
var providerArray = thisService.provider;
|
||||||
|
for(var k = 0; k < providerArray.length; k++) {
|
||||||
|
if(providerArray[k].name == "JuniperSRX") {
|
||||||
|
FirewallProviderArrayIncludesJuniperSRX = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(thisService.name == "PortForwarding") {
|
||||||
havingPortForwardingService = true;
|
havingPortForwardingService = true;
|
||||||
if(thisService.name == "Lb")
|
}
|
||||||
|
if(thisService.name == "Lb") {
|
||||||
havingLbService = true;
|
havingLbService = true;
|
||||||
if(thisService.name == "Vpn")
|
}
|
||||||
|
if(thisService.name == "Vpn") {
|
||||||
havingVpnService = true;
|
havingVpnService = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1961,6 +1974,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(FirewallProviderArrayIncludesJuniperSRX == true) { //if Firewall is provided by JuniperSRX
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('listPortForwardingRules'),
|
||||||
|
data: {
|
||||||
|
ipaddressid: args.context.ipAddresses[0].id,
|
||||||
|
listAll: true
|
||||||
|
},
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
var rules = json.listportforwardingrulesresponse.portforwardingrule;
|
||||||
|
if(rules != null && rules.length > 0) {
|
||||||
|
disallowedActions.push("firewall"); //hide Firewall icon when Port forwarding is configured on IP Address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return disallowedActions;
|
return disallowedActions;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user