cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject 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 Tue, 16 Oct 2012 22:33:42 GMT
Updated Branches:
  refs/heads/autoscale c65a4201a -> 8485505ca


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/8485505c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/8485505c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/8485505c

Branch: refs/heads/autoscale
Commit: 8485505ca8edbdcf277993ee5d8cdc6708ff4f96
Parents: c65a420
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Tue Oct 16 15:17:51 2012 -0700
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Tue Oct 16 15:33:11 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8485505c/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 95fcf66..9f8e4f9 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -2029,14 +2029,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