Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6CF1A18C8E for ; Wed, 20 Jan 2016 21:40:02 +0000 (UTC) Received: (qmail 8800 invoked by uid 500); 20 Jan 2016 21:40:01 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 8754 invoked by uid 500); 20 Jan 2016 21:40:01 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 8708 invoked by uid 99); 20 Jan 2016 21:40:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jan 2016 21:40:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BAA37DFF94; Wed, 20 Jan 2016 21:40:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: remi@apache.org To: commits@cloudstack.apache.org Date: Wed, 20 Jan 2016 21:40:01 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/7] git commit: updated refs/heads/master to ce4ea45 CLOUDSTACK-9235: Autoscale button is missing in VPC In case of VPC, it checks the services available. If LB is there, It checks the provider is Netscaler then it shows the button or hides it. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b02e9f00 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b02e9f00 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b02e9f00 Branch: refs/heads/master Commit: b02e9f00106a705e862cd859e021d21c9780da68 Parents: 80703ca Author: Nitin Kumar Maharana Authored: Thu Jan 14 12:04:13 2016 +0530 Committer: Nitin Kumar Maharana Committed: Thu Jan 14 12:04:13 2016 +0530 ---------------------------------------------------------------------- ui/scripts/network.js | 49 +++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b02e9f00/ui/scripts/network.js ---------------------------------------------------------------------- diff --git a/ui/scripts/network.js b/ui/scripts/network.js index cdfbcaa..e4a54e1 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -3643,22 +3643,7 @@ 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; - } - } - } + lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services); } }); if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter) @@ -3667,8 +3652,16 @@ return 2; //hide Autoscale button (both header and form) } } else { //from VPC section - //VPC doesn't support autoscale - return 2; + var lbProviderIsNetscaler; + var services = args.context.vpc[0].service; + + lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services); + + 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) + } } } }, @@ -6525,6 +6518,26 @@ } }; + function checkIfNetScalerProviderIsEnabled(services) { + 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') { + return true; + } + } + } + return false; + } + } + } + + return false; + } + function getExtaPropertiesForIpObj(ipObj, args) { if (!('vpc' in args.context)) { //***** Guest Network section > Guest Network page > IP Address page ***** var services = args.context.networks[0].service;