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/master to 9c5b293
Date Thu, 08 Aug 2013 23:26:13 GMT
Updated Branches:
  refs/heads/master 99c3e4f3f -> 9c5b293fe


CLOUDSTACK-4069: listNetworkOfferings API has been changed to not return system-owned network
offerings to regular user(domain user). Therefore, change UI to determine whether a network
is EIP/ELB upon 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/9c5b293f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9c5b293f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9c5b293f

Branch: refs/heads/master
Commit: 9c5b293fe093cbed885de6f1a5f6352aca164959
Parents: 99c3e4f
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Aug 8 16:21:51 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu Aug 8 16:26:04 2013 -0700

----------------------------------------------------------------------
 ui/scripts/network.js | 51 +++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9c5b293f/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index cf6b3c3..5a9faff 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1964,34 +1964,35 @@
 
                                 if (zoneObj.networktype == 'Basic') {
                                     var havingEIP = false,
-                                        havingELB = false;
-                                    $.ajax({
-                                        url: createURL('listNetworkOfferings'),
-                                        data: {
-                                            id: args.context.networks[0].networkofferingid
-                                        },
-                                        async: false,
-                                        success: function(json) {
-                                            $(json.listnetworkofferingsresponse.networkoffering[0].service).each(function()
{
-                                                var thisService = this;
-                                                if (thisService.name == "StaticNat") {
-                                                    $(thisService.capability).each(function()
{
-                                                        if (this.name == "ElasticIp" &&
this.value == "true") {
+                                        havingELB = false;     
+                                    
+                                    var services = args.context.networks[0].service;
+                                    if(services != null) {
+                                    	for(var i = 0; i < services.length; i++) {      
                             		
+                                    		var thisService = services[i];
+                                    		var capabilities = thisService.capability;
+                                            if (thisService.name == "StaticNat") {      
                                     	
+                                            	if(capabilities != null) {
+                                            		for(var k = 0; k < capabilities.length;
k++) {                                            			
+                                            			if (capabilities[k].name == "ElasticIp" &&
capabilities[k].value == "true") {                                            				
                                                             havingEIP = true;
-                                                            return false; //break $.each()
loop
+                                                            break; 
                                                         }
-                                                    });
-                                                } else if (thisService.name == "Lb") {
-                                                    $(thisService.capability).each(function()
{
-                                                        if (this.name == "ElasticLb" &&
this.value == "true") {
-                                                            havingELB = true;
-                                                            return false; //break $.each()
loop
+                                            		}
+                                            	}                                     	
+                                            } else if (thisService.name == "Lb") {
+                                            	if(capabilities != null) {
+                                            		for(var k = 0; k < capabilities.length;
k++) {                                            			
+                                            			if (capabilities[k].name == "ElasticLb" &&
capabilities[k].value == "true") {                                            				
+                                            				havingELB = true;
+                                                            break; 
                                                         }
-                                                    });
-                                                }
-                                            });
-                                        }
-                                    });
+                                            		}
+                                            	}     
+                                            }                                    		
+                                    	}
+                                    }
+                                    
                                     if (havingEIP != true || havingELB != true) { //not EIP-ELB
                                         return false; //acquire new IP is not allowed in
non-EIP-ELB basic zone
                                     }


Mime
View raw message