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 5e9dea1
Date Wed, 06 Nov 2013 19:36:23 GMT
Updated Branches:
  refs/heads/4.2 2210f1b0e -> 5e9dea1fc


CLOUDSTACK-5048: UI > VPC section > Create Load Balancing rule > hide Autoscale button
since Autoscale is not supported in VPC.


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

Branch: refs/heads/4.2
Commit: 5e9dea1fc59b87f12dcac98b5d41d89d63fd2d55
Parents: 2210f1b
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed Nov 6 11:36:03 2013 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed Nov 6 11:36:13 2013 -0800

----------------------------------------------------------------------
 ui/scripts/network.js | 72 ++++++++++++++++++++++++----------------------
 1 file changed, 38 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e9dea1f/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 4595834..8a8904e 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3375,41 +3375,45 @@
                                                     buttonLabel: 'label.configure',
                                                     action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler)
                                                 },
-                                                isHidden: function(args) {              
                                 
-                                                    var lbProviderIsNetscaler = false;
-                                                    $.ajax({
-                                                    	url: createURL('listNetworkOfferings'),
-                                                    	data: {
-                                                    		id: args.context.networks[0].networkofferingid
-                                                    	},
-                                                    	async: false,
-                                                    	success: function(json) {          
                                         		
-                                                    		var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
                                                   		
-                                                    		var services = networkOffering.service;
-                                                    		if (services != null) {
-	                                                    		for (var i = 0; i < services.length;
i++) {
-	                                                    			if (services[i].name == 'Lb') {
-	                                                    				var providers = services[i].provider;
-	                                                    				if (providers != null) {
-		                                                    				for (var k = 0; k < providers.length;
k++) {
-		                                                    					if (providers[k].name == 'Netscaler')
{
-		                                                    						lbProviderIsNetscaler = true;
-		                                                    						break;
-		                                                    					}
-		                                                    				}  
-	                                                    				}
-	                                                    				break;
-	                                                    			}
+                                                isHidden: function(args) {      
+                                                	if (!('vpc' in args.context)) {  //from
Guest Network section                                       	
+	                                                	var lbProviderIsNetscaler = false;
+	                                                    $.ajax({
+	                                                    	url: createURL('listNetworkOfferings'),
+	                                                    	data: {
+	                                                    		id: args.context.networks[0].networkofferingid
+	                                                    	},
+	                                                    	async: false,
+	                                                    	success: function(json) {         
                                          		
+	                                                    		var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
                                                   		
+	                                                    		var services = networkOffering.service;
+	                                                    		if (services != null) {
+		                                                    		for (var i = 0; i < services.length;
i++) {
+		                                                    			if (services[i].name == 'Lb') {
+		                                                    				var providers = services[i].provider;
+		                                                    				if (providers != null) {
+			                                                    				for (var k = 0; k < providers.length;
k++) {
+			                                                    					if (providers[k].name == 'Netscaler')
{
+			                                                    						lbProviderIsNetscaler = true;
+			                                                    						break;
+			                                                    					}
+			                                                    				}  
+		                                                    				}
+		                                                    				break;
+		                                                    			}
+		                                                    		}
 	                                                    		}
-                                                    		}
-                                                    	}
-                                                    });                                 
                     
-                                                    
-                                                    if (lbProviderIsNetscaler == true) {
//AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
-                                                    	return false; //show AutoScale button
-                                                    } else {
-                                                    	return 2; //hide Autoscale button (both
header and form)
-                                                    }                                   
            	
+	                                                    	}
+	                                                    });    
+	                                                    if (lbProviderIsNetscaler == true) {
//AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
+	                                                    	return false; //show AutoScale button
+	                                                    } else {
+	                                                    	return 2; //hide Autoscale button (both
header and form)
+	                                                    }     
+                                                    } else { //from VPC section
+                                                    	//VPC doesn't support autoscale
+                                                    	return 2;
+                                                    }   
                                                 }
                                             },
 


Mime
View raw message