You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/10/18 23:36:06 UTC
git commit: cloudstack UI - Static NAT,
Port Forwarding and Firewall Implementation on JuniperSRX - IP
Address page - configuration - Firewall - exclude ICMP from Protocol
dropdown.
Updated Branches:
refs/heads/master 640aba7a7 -> b7ccae0dd
cloudstack UI - Static NAT, Port Forwarding and Firewall Implementation on JuniperSRX - IP Address page - configuration - Firewall - exclude ICMP from Protocol dropdown.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/b7ccae0d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b7ccae0d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b7ccae0d
Branch: refs/heads/master
Commit: b7ccae0dde6f6949e5314036a7aa71460d676316
Parents: 640aba7
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Oct 17 16:34:28 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Thu Oct 18 14:35:47 2012 -0700
----------------------------------------------------------------------
ui/scripts/network.js | 42 ++++++++++++++++++++++++++++++++++--------
1 files changed, 34 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b7ccae0d/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 3ff35b4..e8ee861 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -2003,14 +2003,40 @@
$icmpFields.parent().find('label.error').hide();
}
});
-
- args.response.success({
- data: [
- { name: 'tcp', description: 'TCP' },
- { name: 'udp', description: 'UDP' },
- { name: 'icmp', description: 'ICMP' }
- ]
- });
+
+ var data = [
+ { name: 'tcp', description: 'TCP' },
+ { name: 'udp', description: 'UDP' }
+ ];
+ //ICMP portocol is not supported in Firewall provided by JuniperSRX
+ $.ajax({
+ url: createURL('listNetworkOfferings'),
+ data: {
+ id: args.context.networks[0].networkofferingid
+ },
+ async: false,
+ success: function(json) {
+ var serviceArray = json.listnetworkofferingsresponse.networkoffering[0].service;
+ var FirewallProviderArrayIncludesJuniperSRX = false;
+ for(var i = 0; i < serviceArray.length; i++) {
+ if(serviceArray[i].name == "Firewall") {
+ var providerArray = serviceArray[i].provider;
+ for(var k = 0; k < providerArray.length; k++) {
+ if(providerArray[k].name == "JuniperSRX") {
+ FirewallProviderArrayIncludesJuniperSRX = true;
+ break;
+ }
+ }
+ break;
+ }
+ }
+ if(FirewallProviderArrayIncludesJuniperSRX == false) {
+ data.push({ name: 'icmp', description: 'ICMP' }); //show ICMP option only when provider is not JuniperSRX
+ }
+ }
+ });
+
+ args.response.success({data: data});
}
},
'startport': { edit: true, label: 'label.start.port' },