You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2012/10/25 21:07:48 UTC
git commit: Support IP address and services UI for shared networks
Updated Branches:
refs/heads/master cc8b97ce9 -> 062190ccd
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.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/062190cc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/062190cc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/062190cc
Branch: refs/heads/master
Commit: 062190ccd807094fd136f017c8aba34bd8f56e83
Parents: cc8b97c
Author: Brian Federle <br...@citrix.com>
Authored: Thu Oct 25 12:02:13 2012 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Thu Oct 25 12:07:45 2012 -0700
----------------------------------------------------------------------
ui/scripts/network.js | 44 +++++---------------------------------------
1 files changed, 5 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/062190cc/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index f437c71..2cf5bbb 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;