ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-12959 FE: Server overloaded with POST calls after changing config group. (atkach)
Date Wed, 02 Sep 2015 11:06:19 GMT
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 <atkach@hortonworks.com>
Authored: Tue Sep 1 16:14:07 2015 +0300
Committer: Andrii Tkach <atkach@hortonworks.com>
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({
    * <code>config.stackConfigProperty.valueAttributes.{group.name}.maximum<code>
    * @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


Mime
View raw message