You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2015/05/28 01:27:51 UTC
ambari git commit: AMBARI-11444. Number Widgets: Empty threshold for
'Critical' still shows the value as Critical.(XIWANG)
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 <xi...@apache.org>
Authored: Wed May 27 14:42:04 2015 -0700
Committer: Xi Wang <xi...@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';