You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2015/06/05 12:31:08 UTC
[2/2] ambari git commit: AMBARI-11716 Gauge widget: when data is not
available then display n/a. (atkach)
AMBARI-11716 Gauge widget: when data is not available then display n/a. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ed3d49a5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ed3d49a5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ed3d49a5
Branch: refs/heads/trunk
Commit: ed3d49a59eb8ee51300882bd847ad79682fd5b5e
Parents: d622872
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Fri Jun 5 12:53:45 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Fri Jun 5 12:53:45 2015 +0300
----------------------------------------------------------------------
ambari-web/app/styles/enhanced_service_dashboard.less | 3 +++
ambari-web/app/templates/common/widget/gauge_widget.hbs | 10 +++++++++-
ambari-web/app/views/common/widget/gauge_widget_view.js | 7 +++++++
3 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed3d49a5/ambari-web/app/styles/enhanced_service_dashboard.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/enhanced_service_dashboard.less b/ambari-web/app/styles/enhanced_service_dashboard.less
index 50c1292..bde2828 100644
--- a/ambari-web/app/styles/enhanced_service_dashboard.less
+++ b/ambari-web/app/styles/enhanced_service_dashboard.less
@@ -147,6 +147,9 @@
.frame;
.content {
padding-top: 40px;
+ .unavailable {
+ padding-top: 30px;
+ }
}
}
.red {
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed3d49a5/ambari-web/app/templates/common/widget/gauge_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/widget/gauge_widget.hbs b/ambari-web/app/templates/common/widget/gauge_widget.hbs
index 97c158d..9463c87 100644
--- a/ambari-web/app/templates/common/widget/gauge_widget.hbs
+++ b/ambari-web/app/templates/common/widget/gauge_widget.hbs
@@ -30,7 +30,15 @@
<i class="icon-edit"></i>
</a>
{{/isAccessible}}
- <div class="content"> {{view view.chartView}}</div>
+ <div class="content">
+ {{#if view.isUnavailable}}
+ <div class="grey unavailable">
+ {{t common.na}}
+ </div>
+ {{else}}
+ {{view view.chartView}}
+ {{/if}}
+ </div>
{{#if view.content.description}}
<div class="hidden-description">
{{view.content.description}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed3d49a5/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 acc8d4b..3d782cd 100644
--- a/ambari-web/app/views/common/widget/gauge_widget_view.js
+++ b/ambari-web/app/views/common/widget/gauge_widget_view.js
@@ -32,6 +32,13 @@ App.GaugeWidgetView = Em.View.extend(App.WidgetMixin, {
*/
metrics: [],
+ /**
+ * @type {boolean}
+ */
+ isUnavailable: function () {
+ return isNaN(parseFloat(this.get('value')));
+ }.property('value'),
+
chartView: App.ChartPieView.extend({
stroke: '#D6DDDF', //light grey
innerR: 25,