瀏覽代碼

AMBARI-2197. Jobs page usability issues - remove the "ramps". (srimanth)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1485916 13f79535-47bb-0310-9956-ffa450edef68
Srimanth 12 年之前
父節點
當前提交
f2f9fe0e5a
共有 3 個文件被更改,包括 30 次插入3 次删除
  1. 2 0
      CHANGES.txt
  2. 27 2
      ambari-web/app/mappers/jobs_mapper.js
  3. 1 1
      ambari-web/vendor/scripts/workflow_visualization.js

+ 2 - 0
CHANGES.txt

@@ -895,6 +895,8 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2197. Jobs page usability issues - remove the "ramps". (srimanth)
+
  AMBARI-2196. Install Wizard, Customize Services changes. (srimanth)
 
  AMBARI-2193. Remove zookeeper dependency for HIVE and HCAT. (srimanth)

+ 27 - 2
ambari-web/app/mappers/jobs_mapper.js

@@ -64,10 +64,35 @@ App.jobTimeLineMapper = App.QuickDataMapper.create({
   map:function (json) {
     var job = this.get('model'); // @model App.MainAppsItemBarView
     var parseResult = this.parseIt(json, this.config);
-
+    var self = this;
     $.each(parseResult, function (field, value) {
-      job.set(field, value);
+      var d = self.coordinatesModify(value);
+      d.reverse();
+      d = self.coordinatesModify(d);
+      d.reverse();
+      job.set(field, d);
+    });
+  },
+
+  coordinatesModify: function(data) {
+    var d = this.zeroAdding(data);
+    d.reverse();
+    d = this.zeroAdding(d);
+    d.reverse();
+    return d;
+  },
+
+  zeroAdding: function(data) {
+    var d = [];
+    var last_y = 0;
+    data.forEach(function(coordinates) {
+      if (coordinates.y != 0 && last_y == 0) {
+        d.push({x: coordinates.x, y: 0});
+      }
+      d.push(coordinates);
+      last_y = coordinates.y;
     });
+    return d;
   }
 });
 

+ 1 - 1
ambari-web/vendor/scripts/workflow_visualization.js

@@ -383,7 +383,7 @@ DagViewer.prototype.addTimeSeries = function (series, position, name) {
     .attr("class", function(d) { return d.name;})
     .attr("style", function(d) {
       if (d.name.substring(0,3)=="all")
-        return "stroke:"+d3.interpolateRgb(d.color, 'black')(0.125)+";fill:white"; 
+        return "";
       else
         return "stroke:"+d3.interpolateRgb(d.color, 'black')(0.125)+";fill:"+d.color; 
     })