cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject [5/50] git commit: CS-16459: cloudstack UI - network page - When creating Lb rules for a network that is not using netscaler for LB service, AutoScale button is hidden.
Date Fri, 16 Nov 2012 10:00:31 GMT
CS-16459: cloudstack UI - network page - When creating Lb rules for a network that is not using
netscaler for LB service, AutoScale button is hidden.


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

Branch: refs/heads/master
Commit: 8fdd0a469af768b462af1cc6ed7b795a59272e4d
Parents: 527b5c8
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Tue Oct 16 15:17:51 2012 -0700
Committer: Vijay Venkatachalam <vijay.venkatachalam@citrix.com>
Committed: Fri Nov 16 10:57:00 2012 +0530

----------------------------------------------------------------------
 ui/scripts/network.js |   38 ++++++++++++++++++++++++++++++++------
 1 files changed, 32 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8fdd0a46/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index bf580e0..15ee363 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -2431,14 +2431,40 @@
                       }
                     },
                     multipleAdd: true,
-                    fieldPreFilter: function(args) {
-                      var context = args.context;
-                      var fields = args.fields;
 
-                      var hiddenFields = [];
+                    fieldPreFilter: function(args) {                        
+											var hiddenFields = [];		
 											if('vpc' in args.context) { //from VPC section
-											  hiddenFields.push('autoScale');
-											}																					
+											  hiddenFields.push('autoScale'); //autoScale is not supported in VPC
+											}		
+                      else { //from Guest Network section 											  
+                        $.ajax({
+												  url: createURL('listNetworkOfferings'),
+													data: {
+													  id: args.context.networks[0].networkofferingid
+													},
+													async: false,
+													success: function(json) {													  
+														var serviceArray = json.listnetworkofferingsresponse.networkoffering[0].service;
+														var lbProviderArrayIncludesNetscaler = false;
+														for(var i = 0; i < serviceArray.length; i++) {
+														  if(serviceArray[i].name == "Lb") {
+															  var providerArray = serviceArray[i].provider;
+																for(var k = 0; k < providerArray.length; k++) {
+																  if(providerArray[k].name == "Netscaler") {
+																	  lbProviderArrayIncludesNetscaler = true;
+																		break;
+																	}
+																}																					
+															  break;
+															}															
+														}														
+														if(lbProviderArrayIncludesNetscaler == false) {
+														  hiddenFields.push('autoScale'); //autoScale is not supported in a network
that is not using Netscaler provider for LB service (CS-16459)
+														}		
+													}
+												});											  
+                      }											
                       return hiddenFields; // Returns fields to be hidden
                     },
                     fields: {


Mime
View raw message