소스 검색

AMBARI-5107. Job Tez DAG vertex start/end time should show seconds also (alexantonenko)

Alex Antonenko 11 년 전
부모
커밋
4351f73b96
2개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 2
      ambari-web/app/utils/date.js
  2. 2 2
      ambari-web/app/views/main/jobs/hive_job_details_view.js

+ 6 - 2
ambari-web/app/utils/date.js

@@ -31,12 +31,16 @@ module.exports = {
    * @param timestamp
    * @return string date
    */
-  dateFormat:function (timestamp) {
+  dateFormat:function (timestamp, showSeconds) {
     if (!validator.isValidInt(timestamp)) return timestamp;
     var date = new Date(timestamp);
     var months = this.dateMonths;
     var days = this.dateDays;
-    return days[date.getDay()] + ', ' + months[date.getMonth()] + ' ' + this.dateFormatZeroFirst(date.getDate()) + ', ' + date.getFullYear() + ' ' + this.dateFormatZeroFirst(date.getHours()) + ':' + this.dateFormatZeroFirst(date.getMinutes());
+    var formattedDate = days[date.getDay()] + ', ' + months[date.getMonth()] + ' ' + this.dateFormatZeroFirst(date.getDate()) + ', ' + date.getFullYear() + ' ' + this.dateFormatZeroFirst(date.getHours()) + ':' + this.dateFormatZeroFirst(date.getMinutes());
+    if (showSeconds) {
+      formattedDate += ':' + this.dateFormatZeroFirst(date.getSeconds());
+    };
+    return formattedDate;
   },
   /**
    * Convert timestamp to date-string 'DAY_OF_THE_WEEK MONTH DAY YEAR'

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

@@ -211,8 +211,8 @@ App.MainHiveJobDetailsView = Em.View.extend({
         read : v.get('recordReadCount') == null ? null : Em.I18n.t('jobs.hive.tez.records.count').format(v.get('recordReadCount')),
         write : v.get('recordWriteCount') == null ? null : Em.I18n.t('jobs.hive.tez.records.count').format(v.get('recordWriteCount'))
       },
-      started: v.get('startTime') ? dateUtils.dateFormat(v.get('startTime')) : '',
-      ended: v.get('endTime') ? dateUtils.dateFormat(v.get('endTime')) : '',
+      started: v.get('startTime') ? dateUtils.dateFormat(v.get('startTime'), true) : '',
+      ended: v.get('endTime') ? dateUtils.dateFormat(v.get('endTime'), true) : '',
       status: status
     };
   }.property('selectedVertex.fileReadOps', 'selectedVertex.fileWriteOps', 'selectedVertex.hdfsReadOps', 'selectedVertex.hdfdWriteOps',