Browse Source

AMBARI-4588. Vertices in Tez DAG details page should be sorted (srimanth)

Srimanth Gunturi 11 years ago
parent
commit
ccb61e86d1

+ 1 - 1
ambari-web/app/templates/main/jobs/hive_job_details.hbs

@@ -72,7 +72,7 @@
                   </tr>
                 </thead>
                 <tbody>
-                  {{#each vertex in view.content.tezDag.vertices}}
+                  {{#each vertex in view.sortedVertices}}
                     <tr {{bindAttr class="vertex.isSelected:info"}}>
                       <td>
                         <a title="{{vertex.name}}" href="#" {{action "doSelectVertex" vertex target="view"}}>{{vertex.name}}</a>

+ 11 - 0
ambari-web/app/views/main/jobs/hive_job_details_view.js

@@ -31,6 +31,17 @@ App.MainHiveJobDetailsView = Em.View.extend({
     return Em.I18n.t('jobs.hive.tez.metric.'+this.get('summaryMetricType'));
   }.property('summaryMetricType'),
 
+  sortedVertices : function() {
+    var vertices = this.get('content.tezDag.vertices');
+    if (vertices != null) {
+      vertices = vertices.toArray();
+      return vertices.sort(function(v1, v2) {
+        return Ember.compare(v1.get('name'), v2.get('name'));
+      });
+    }
+    return vertices;
+  }.property('content.tezDag.vertices'),
+
   initialDataLoaded : function() {
     var loaded = this.get('controller.loaded');
     if (loaded) {