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-11711. Dashboard: graph descriptions are not very visible on service dashboard page.(xiwang)
Date Fri, 05 Jun 2015 18:41:59 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 4a825b8bc -> b292893e1


AMBARI-11711. Dashboard: graph descriptions are not very visible on service dashboard page.(xiwang)


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

Branch: refs/heads/branch-2.1
Commit: b292893e125994d5000540b69b42371027df7f76
Parents: 4a825b8
Author: Xi Wang <xiwang@apache.org>
Authored: Thu Jun 4 17:52:02 2015 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Fri Jun 5 11:42:05 2015 -0700

----------------------------------------------------------------------
 .../app/styles/enhanced_service_dashboard.less  | 22 ++++++++++++++++++++
 .../app/templates/main/charts/linear_time.hbs   |  6 ------
 .../app/views/common/chart/linear_time.js       |  3 ++-
 ambari-web/vendor/scripts/rickshaw.js           | 18 ++++++++++++++++
 4 files changed, 42 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b292893e/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 bde2828..0ff9c88 100644
--- a/ambari-web/app/styles/enhanced_service_dashboard.less
+++ b/ambari-web/app/styles/enhanced_service_dashboard.less
@@ -237,6 +237,28 @@
       background: rgba(255,255,255, 0.7);
     }
   }
+  .thumbnail .chart-legend ul {
+    max-width: 300px;
+    .description-line {
+      padding: 3px 3px 8px 8px;
+      line-height: 16px;
+      max-height: 43px;
+      font-weight: bold;
+      word-wrap: break-word;
+      white-space: pre-wrap;
+      overflow: scroll;
+    }
+  }
+}
+
+.chart-legend .description-line {
+  padding: 0px 3px 8px 8px;
+  line-height: 16px;
+  max-height: 45px;
+  font-weight: bold;
+  word-wrap: break-word;
+  white-space: pre-wrap;
+  overflow: scroll;
 }
 
 #edit-widget-wizard,

http://git-wip-us.apache.org/repos/asf/ambari/blob/b292893e/ambari-web/app/templates/main/charts/linear_time.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/charts/linear_time.hbs b/ambari-web/app/templates/main/charts/linear_time.hbs
index b6bd6d0..24c13e9 100644
--- a/ambari-web/app/templates/main/charts/linear_time.hbs
+++ b/ambari-web/app/templates/main/charts/linear_time.hbs
@@ -30,9 +30,3 @@
   {{/unless}}
 </div>
 
-{{#if view.description}}
-  <div class="hidden-description" {{action showGraphInPopup target="view"}}>
-    {{view.description}}
-  </div>
-{{/if}}
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/b292893e/ambari-web/app/views/common/chart/linear_time.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js
index dbffe4b..7737700 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -593,7 +593,8 @@ App.ChartLinearTimeView = Ember.View.extend({
 
     var legend = new Rickshaw.Graph.Legend({
       graph: _graph,
-      element: legendElement
+      element: legendElement,
+      description: self.get('description')
     });
 
     new Rickshaw.Graph.Behavior.Series.Toggle({

http://git-wip-us.apache.org/repos/asf/ambari/blob/b292893e/ambari-web/vendor/scripts/rickshaw.js
----------------------------------------------------------------------
diff --git a/ambari-web/vendor/scripts/rickshaw.js b/ambari-web/vendor/scripts/rickshaw.js
index 6beb828..8be0f97 100644
--- a/ambari-web/vendor/scripts/rickshaw.js
+++ b/ambari-web/vendor/scripts/rickshaw.js
@@ -1445,6 +1445,7 @@ Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
 	var self = this;
 
 	this.addAnchor = function(line) {
+    if (line.noAnchor) return;
 		var anchor = document.createElement('a');
 		anchor.innerHTML = '&#10004;';
 		anchor.classList.add('action');
@@ -1830,6 +1831,23 @@ Rickshaw.Graph.Legend = function(args) {
 		self.lines.push(_line);
 	};
 
+  this.addDescription = function (description) {
+    if (!description) return;
+    var line = document.createElement('div');
+    line.className = 'description-line';
+
+    var label = document.createElement('span');
+    label.innerHTML = description;
+
+    line.appendChild(label);
+    list.appendChild(line);
+
+    var _line = { element: line, noAnchor: true};
+    self.lines.push(_line);
+  };
+
+  self.addDescription(args.description);
+
 	series.forEach( function(s) {
 		self.addLine(s);
 	} );


Mime
View raw message