From 33482d35e802ac3468317b844122b347fe486861 Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Fri, 3 Aug 2018 13:58:41 +0530 Subject: [PATCH] YARN-8603. [UI2] Latest run application should be listed first in the RM UI. Contributed by Akhil PB. --- .../src/main/webapp/app/controllers/app-table-columns.js | 7 +++++++ .../src/main/webapp/app/controllers/yarn-apps/apps.js | 4 +++- .../src/main/webapp/app/serializers/yarn-app.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js index 33e3bb70e1..552a157dd1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js @@ -20,6 +20,7 @@ import Ember from 'ember'; import ColumnDef from 'em-table/utils/column-definition'; import TableDef from 'em-table/utils/table-definition'; +import Converter from 'yarn-ui/utils/converter'; export default Ember.Controller.extend({ tableDefinition: TableDef.create({ @@ -83,6 +84,9 @@ export default Ember.Controller.extend({ headerTitle: 'Start Time', contentPath: 'startTime', facetType: null, + getCellContent: function(row) { + return Converter.timeStampToDate(row.get('startTime')); + } }, { id: 'elTime', headerTitle: 'Elapsed Time', @@ -169,6 +173,9 @@ export default Ember.Controller.extend({ headerTitle: 'Started Time', contentPath: 'startTime', facetType: null, + getCellContent: function(row) { + return Converter.timeStampToDate(row.get('startTime')); + } }, { id: 'finishTime', headerTitle: 'Finished Time', diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js index 55d5a8888b..10965cf0e3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js @@ -25,7 +25,9 @@ export default AppTableController.extend({ tableDefinition: TableDefinition.create({ searchType: 'manual', enableFaceting: true, - rowCount: 25 + rowCount: 25, + sortColumnId: 'stTime', + sortOrder: 'desc' }), searchText: Ember.computed.alias('tableDefinition.searchText'), sortColumnId: Ember.computed.alias('tableDefinition.sortColumnId'), diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js index 36d1260c6a..f4de7257c0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js @@ -42,7 +42,7 @@ export default DS.JSONAPISerializer.extend({ user: payload.user, queue: payload.queue, state: payload.state, - startTime: Converter.timeStampToDate(payload.startedTime), + startTime: payload.startedTime, // will be formatted in em-table elapsedTime: payload.elapsedTime, finishedTime: Converter.timeStampToDate(payload.finishedTime), finalStatus: payload.finalStatus,