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 ff0bfe2
Date Wed, 06 Nov 2013 20:30:44 GMT
Updated Branches:
  refs/heads/master 8def7e9f8 -> ff0bfe209


CLOUDSTACK-5048: UI > Create Load Balancing rule > hide Autoscale button if LB provider
is not Netscaler since Autoscale is only supported on Netscaler, but not on other provider
like VirtualRouter.


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

Branch: refs/heads/master
Commit: ff0bfe209c3f211d57acc2d2b5027bae134b7072
Parents: 8def7e9
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Nov 5 15:11:05 2013 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed Nov 6 12:30:31 2013 -0800

----------------------------------------------------------------------
 ui/scripts/network.js | 40 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 35 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff0bfe20/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 4915691..c26a6a8 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3369,11 +3369,41 @@
                                                     buttonLabel: 'label.configure',
                                                     action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler)
                                                 },
-                                                isHidden: function(args) {
-                                                    // return 2 == hide header and form,
as well as returned item column
-                                                    // return 2;
-
-                                                    return false;
+                                                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;
+	                                                    			}
+	                                                    		}
+                                                    		}
+                                                    	}
+                                                    });                                 
                     
+                                                    
+                                                    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)
+                                                    }                                   
            	
                                                 }
                                             },
 


Mime
View raw message