ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject ambari git commit: AMBARI-11444. Number Widgets: Empty threshold for 'Critical' still shows the value as Critical.(XIWANG)
Date Wed, 27 May 2015 23:27:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 39b56b482 -> 510a2dd26


AMBARI-11444. Number Widgets: Empty threshold for 'Critical' still shows the value as Critical.(XIWANG)


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

Branch: refs/heads/trunk
Commit: 510a2dd26d06bc5860b8466fce0c1cd89a152fe5
Parents: 39b56b4
Author: Xi Wang <xiwang@apache.org>
Authored: Wed May 27 14:42:04 2015 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Wed May 27 16:27:36 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/views/common/widget/gauge_widget_view.js  | 2 +-
 ambari-web/app/views/common/widget/number_widget_view.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/510a2dd2/ambari-web/app/views/common/widget/gauge_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/widget/gauge_widget_view.js b/ambari-web/app/views/common/widget/gauge_widget_view.js
index 21f6f95..acc8d4b 100644
--- a/ambari-web/app/views/common/widget/gauge_widget_view.js
+++ b/ambari-web/app/views/common/widget/gauge_widget_view.js
@@ -89,7 +89,7 @@ App.GaugeWidgetView = Em.View.extend(App.WidgetMixin, {
           scheme: [ '#FFFFFF', color_green  ].reverse()
         }));
         return color_green;
-      } else if (!isNaN(threshold2) && used.isInRange(threshold1, threshold2)) {
+      } else if ((!isNaN(threshold2) && used.isInRange(threshold1, threshold2)) ||
(isNaN(threshold2) && used > threshold1) ) {
         this.set('palette', new Rickshaw.Color.Palette({
           scheme: [ '#FFFFFF', color_orange  ].reverse()
         }));

http://git-wip-us.apache.org/repos/asf/ambari/blob/510a2dd2/ambari-web/app/views/common/widget/number_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/widget/number_widget_view.js b/ambari-web/app/views/common/widget/number_widget_view.js
index 302f3a7..33bf34e 100644
--- a/ambari-web/app/views/common/widget/number_widget_view.js
+++ b/ambari-web/app/views/common/widget/number_widget_view.js
@@ -54,7 +54,7 @@ App.NumberWidgetView = Em.View.extend(App.WidgetMixin, {
       return 'grey';
     } else if (isNaN(threshold1) || (isNaN(threshold2) && value <= threshold1)
|| (!isNaN(threshold2) && (threshold1 > threshold2) && (value > threshold1))
|| (!isNaN(threshold2) && (threshold1 < threshold2) && (value <= threshold1)))
{
       return 'green';
-    } else if (!isNaN(threshold2) && value.isInRange(threshold1, threshold2)) {
+    } else if ((!isNaN(threshold2) && value.isInRange(threshold1, threshold2)) ||
((isNaN(threshold2) && value > threshold1))) {
       return 'orange';
     } else {
       return 'red';


Mime
View raw message