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-12117 Heatmaps: Maximum input is reseting every 15 seconds. (atkach)
Date Wed, 24 Jun 2015 11:44:00 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 81427c528 -> 0004fd99f


AMBARI-12117 Heatmaps: Maximum input is reseting every 15 seconds. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0004fd99
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0004fd99
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0004fd99

Branch: refs/heads/trunk
Commit: 0004fd99fc47f7a7c678b13c3f4c242869d69445
Parents: 81427c5
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Wed Jun 24 14:07:04 2015 +0300
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Wed Jun 24 14:34:33 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/utils/ajax/ajax.js                  |  2 +-
 .../app/views/common/widget/heatmap_widget_view.js | 17 ++++++++++-------
 2 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0004fd99/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index f344816..bf482ab 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2544,7 +2544,7 @@ var urls = {
   },
 
   'widgets.hosts.metrics.get': {
-    real: '/clusters/{clusterName}/hosts?fields={metricPaths}&format=null_padding',
+    real: '/clusters/{clusterName}/hosts?fields={metricPaths}',
     mock: '/data/metrics/{serviceName}/Append_num_ops.json'
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0004fd99/ambari-web/app/views/common/widget/heatmap_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/widget/heatmap_widget_view.js b/ambari-web/app/views/common/widget/heatmap_widget_view.js
index c89275a..4c888e5 100644
--- a/ambari-web/app/views/common/widget/heatmap_widget_view.js
+++ b/ambari-web/app/views/common/widget/heatmap_widget_view.js
@@ -28,11 +28,18 @@ App.HeatmapWidgetView = Em.View.extend(App.WidgetMixin, {
   metrics: [],
 
   /**
-   *  racks container  binded in the template
+   *  racks container bound in the template
    *  @type {Array}
    */
   racks: [],
 
+  onMetricsLoaded: function () {
+    if (!this.get('isLoaded')) {
+      this.set('controller.inputMaximum', this.get('content.properties.max_limit'));
+    }
+    this._super();
+  },
+
   /**
    * draw widget
    */
@@ -49,14 +56,12 @@ App.HeatmapWidgetView = Em.View.extend(App.WidgetMixin, {
       var metricObject = App.MainChartHeatmapMetric.create({
         name: this.get('content.displayName'),
         units: this.get('content.properties.display_unit'),
-        maximumValue: this.get('content.properties.max_limit'),
+        maximumValue: this.get('controller.inputMaximum'),
         hostNames: hostNames,
         hostToValueMap: hostToValueMap
       });
 
       this.set('controller.selectedMetric', metricObject);
-
-      this.set('controller.inputMaximum', metricObject.get('maximumValue'));
     }
   },
 
@@ -64,9 +69,7 @@ App.HeatmapWidgetView = Em.View.extend(App.WidgetMixin, {
    * calculate value for heatmap widgets
    */
   calculateValues: function () {
-    var metrics = this.get('metrics');
-    var hostToValueMap = this.computeExpression(this.extractExpressions(this.get('content.values')[0]),
metrics);
-    return hostToValueMap;
+    return this.computeExpression(this.extractExpressions(this.get('content.values')[0]),
this.get('metrics'));
   },
 
 


Mime
View raw message