cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/4.2 to 6e42378
Date Wed, 14 Aug 2013 00:57:44 GMT
Updated Branches:
  refs/heads/4.2 36cd824ba -> 6e423784c


CLOUDSTACK-4142: UI > VPC > IP Address > get service list from listNetworks API response
instead of listNetworkOfferings API response.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6e423784
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6e423784
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6e423784

Branch: refs/heads/4.2
Commit: 6e423784c90136687221304db444b4c59b53c251
Parents: 36cd824
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Aug 13 17:55:36 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Tue Aug 13 17:55:36 2013 -0700

----------------------------------------------------------------------
 ui/scripts/network.js | 47 ++++++++++++++++++++++------------------------
 ui/scripts/vpc.js     |  2 +-
 2 files changed, 23 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6e423784/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 2e9bd0e..5642995 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -2657,7 +2657,7 @@
                                         var havingLbService = false;
                                         var havingVpnService = false;
 
-                                        if ('networks' in args.context && args.context.networks[0].vpcid
== null) { //a non-VPC network from Guest Network section
+                                        if (!('vpc' in args.context)) { //from Guest Network
section
                                             var services = args.context.networks[0].service;
                                             if(services != null) {
                                             	for(var i = 0; i < services.length; i++)
{                                    		
@@ -2672,7 +2672,8 @@
                                                         havingVpnService = true;        
                                                                   		
                                             	}
                                             }  
-                                        } else { //a VPC network from Guest Network section
or from VPC section
+                                        } else { //from VPC section
+                                        	//a VPC network from Guest Network section or from
VPC section
                                             // Firewall is not supported in IP from VPC section
                                             // (because ACL has already supported in tier
from VPC section)
                                             havingFirewallService = false;
@@ -2692,29 +2693,25 @@
                                                     },
                                                     async: false,
                                                     success: function(json) {
-                                                        var networkObj = json.listnetworksresponse.network[0];
-                                                        $.ajax({
-                                                            url: createURL("listNetworkOfferings&id="
+ networkObj.networkofferingid),
-                                                            async: false,
-                                                            success: function(json) {
-                                                                var networkoffering = json.listnetworkofferingsresponse.networkoffering[0];
-                                                                $(networkoffering.service).each(function()
{
-                                                                    var thisService = this;
-                                                                    if (thisService.name
== "PortForwarding")
-                                                                        havingPortForwardingService
= true;
-                                                                    if (thisService.name
== "Lb")
-                                                                        havingLbService =
true;
-                                                                });
-                                                            }
-                                                        });
+                                                        var networkObj = json.listnetworksresponse.network[0];
                                                   
+                                                        var services = networkObj.service;
+                                                        if(services != null) {
+                                                        	for(var i = 0; i < services.length;
i++) {
+                                                        		if (services[i].name == "PortForwarding")
+                                                                    havingPortForwardingService
= true;
+                                                                if (services[i].name == "Lb")
+                                                                    havingLbService = true;
+                                                        	}
+                                                        }                               
                
                                                     }
                                                 });
                                             }
                                         }
+                                        
                                         if (args.context.networks[0].networkofferingconservemode
== false) {
                                             /*
-                       (1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer
can be enabled/added.
-                       */
+					                        (1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer
can be enabled/added.
+					                        */
                                             if (args.context.ipAddresses[0].issourcenat)
{
                                                 if (havingFirewallService == false) { //firewall
is not supported in IP from VPC section (because ACL has already supported in tier from VPC
section)
                                                     disallowedActions.push("firewall");
@@ -2725,12 +2722,12 @@
                                             }
 
                                             /*
-                       (2) If IP is non-SourceNat, show StaticNat/VPN/PortForwarding/LoadBalancer
at first.
-                       1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
-                       2. If VPN service is supported (i.e. IP comes from Guest Network section,
not from VPC section), once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
-                       3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
-                       4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
-                       */
+					                        (2) If IP is non-SourceNat, show StaticNat/VPN/PortForwarding/LoadBalancer
at first.
+					                        1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
+					                        2. If VPN service is supported (i.e. IP comes from Guest Network
section, not from VPC section), once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
+					                        3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
+					                        4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
+					                        */
                                             else { //args.context.ipAddresses[0].issourcenat
== false
                                                 if (havingFirewallService == false)
                                                     disallowedActions.push("firewall");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6e423784/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index f6b2a76..bf854d2 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -1155,7 +1155,7 @@
                                 forloadbalancing: true
                             },
                             success: function(json) {
-                                var items = json.listpublicipaddressesresponse;
+                                var items = json.listpublicipaddressesresponse.publicipaddress;
                                 args.response.success({
                                     data: items
                                 });


Mime
View raw message