From 062190ccd807094fd136f017c8aba34bd8f56e83 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 25 Oct 2012 12:02:13 -0700 Subject: [PATCH] Support IP address and services UI for shared networks Currently, the IP addresses section and PF/LB/FW rule configuration is disabled for shared networks; this change enables it for any shared network with the source NAT service enabled. This makes the UI the same for how it is with isolated networks. --- ui/scripts/network.js | 44 +++++-------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index f437c718d85..2cf5bbbc27d 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -555,46 +555,12 @@ if(services == null) return false; - if(args.context.networks[0].type == "Isolated") { - for(var i=0; i < services.length; i++) { - var service = services[i]; - if(service.name == "SourceNat") { - return true; - } - } - } - else if(args.context.networks[0].type == "Shared") { - var havingSecurityGroupService = false; - var havingElasticIpCapability = false; - var havingElasticLbCapability = false; - - for(var i=0; i < services.length; i++) { - var service = services[i]; - if(service.name == "SecurityGroup") { - havingSecurityGroupService = true; - } - else if(service.name == "StaticNat") { - $(service.capability).each(function(){ - if(this.name == "ElasticIp" && this.value == "true") { - havingElasticIpCapability = true; - return false; //break $.each() loop - } - }); - } - else if(service.name == "Lb") { - $(service.capability).each(function(){ - if(this.name == "ElasticLb" && this.value == "true") { - havingElasticLbCapability = true; - return false; //break $.each() loop - } - }); - } - } - - if(havingSecurityGroupService == true && havingElasticIpCapability == true && havingElasticLbCapability == true) + // IP addresses supported for both isolated and shared networks w/ source NAT enabled + for(var i=0; i < services.length; i++) { + var service = services[i]; + if(service.name == "SourceNat") { return true; - else - return false; + } } return false;