Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-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 682BB10B7A for ; Wed, 2 Sep 2015 11:06:19 +0000 (UTC) Received: (qmail 7819 invoked by uid 500); 2 Sep 2015 11:06:19 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 7787 invoked by uid 500); 2 Sep 2015 11:06:19 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 7778 invoked by uid 99); 2 Sep 2015 11:06:19 -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, 02 Sep 2015 11:06:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20BBEDFC7F; Wed, 2 Sep 2015 11:06:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: atkach@apache.org To: commits@ambari.apache.org Message-Id: <47665e76a4c84894b23b35ea614fc85f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-12959 FE: Server overloaded with POST calls after changing config group. (atkach) Date: Wed, 2 Sep 2015 11:06:19 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-2.1 0a624f662 -> 56885a593 AMBARI-12959 FE: Server overloaded with POST calls after changing config group. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/56885a59 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/56885a59 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/56885a59 Branch: refs/heads/branch-2.1 Commit: 56885a5934be6f95b5789ecd6349be2abc8fb7f2 Parents: 0a624f6 Author: Andrii Tkach Authored: Tue Sep 1 16:14:07 2015 +0300 Committer: Andrii Tkach Committed: Wed Sep 2 14:03:23 2015 +0300 ---------------------------------------------------------------------- .../controllers/main/service/info/configs.js | 4 +--- .../widgets/slider_config_widget_view.js | 21 +++++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/56885a59/ambari-web/app/controllers/main/service/info/configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js index b899252..eb06a8a 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -568,9 +568,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A this.setVisibilityForRangerProperties(selectedService); } this._onLoadComplete(); - this.get('configGroups').forEach(function (configGroup) { - this.getRecommendationsForDependencies(null, true, Em.K, configGroup); - }, this); + this.getRecommendationsForDependencies(null, true, Em.K, this.get('selectedConfigGroup')); App.loadTimer.finish('Service Configs Page'); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/56885a59/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js index 8f42336..1e591c0 100644 --- a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js +++ b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js @@ -106,12 +106,27 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({ * config.stackConfigProperty.valueAttributes.{group.name}.maximum * @param {String} attribute - name of attribute, for current moment * can be ["maximum","minimum","increment_step"] but allows to use other it there will be available - * @returns {*} + * @returns {string} */ getValueAttributeByGroup: function(attribute) { + var parseFunction = this.get('parseFunction'); + var configValue = this.get('config.value'); var defaultGroupAttr = this.get('config.stackConfigProperty.valueAttributes'); - var groupAttr = this.get('configGroup') && this.get('config.stackConfigProperty.valueAttributes')[this.get('configGroup.name')]; - return (groupAttr && !Em.isNone(groupAttr[attribute])) ? groupAttr[attribute] : defaultGroupAttr[attribute]; + var groupAttr = this.get('configGroup') && defaultGroupAttr[this.get('configGroup.name')]; + var boundary = (groupAttr && !Em.isNone(groupAttr[attribute])) ? groupAttr[attribute] : defaultGroupAttr[attribute]; + + if (!this.get('referToSelectedGroup')) { + if (attribute === 'minimum') { + if (parseFunction(configValue) < parseFunction(boundary)) { + return configValue; + } + } else if (attribute === 'maximum') { + if (parseFunction(configValue) > parseFunction(boundary)) { + return configValue; + } + } + } + return boundary; }, /** * step transformed form config units to widget units