You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by to...@apache.org on 2018/07/19 12:52:39 UTC

[ambari] branch trunk updated: [AMBARI-23890] [Logsearch UI] Column headers are missing in service logs tabular view (#1769)

This is an automated email from the ASF dual-hosted git repository.

tobiasistvan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 583fc0c  [AMBARI-23890] [Logsearch UI] Column headers are missing in service logs tabular view (#1769)
583fc0c is described below

commit 583fc0ca640351d8153e8c29e67ab1b938f28a95
Author: Istvan Tobias <to...@gmail.com>
AuthorDate: Thu Jul 19 14:52:37 2018 +0200

    [AMBARI-23890] [Logsearch UI] Column headers are missing in service logs tabular view (#1769)
    
    * [AMBARI-23890] [Logsearch UI] Column headers are missing in service logs tabular view
    
    * [AMBARI-23890] [Logsearch UI] Column headers are missing in service logs tabular view
---
 .../service-logs-table.component.html              | 13 ++++
 .../service-logs-table.component.less              | 69 ++++++++++++----------
 .../service-logs-table.component.ts                |  4 +-
 3 files changed, 52 insertions(+), 34 deletions(-)

diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html
index 26ec1df..cacee46 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.html
@@ -58,6 +58,19 @@
           <col *ngIf="isColumnDisplayed('path')" class="log-path">
           <col *ngIf="isColumnDisplayed('log_message')" class="log-message">
         </colgroup>
+        <thead>
+          <tr>
+            <th class="log-action"></th>
+            <th *ngIf="isColumnDisplayed('logtime')">{{getLabelForField('logtime') | translate}}</th>
+            <th *ngIf="isColumnDisplayed('level')">{{getLabelForField('level') | translate}}</th>
+            <th *ngIf="isColumnDisplayed('type')">{{getLabelForField('type') | translate}}</th>
+            <ng-container *ngFor="let column of displayedColumns">
+              <th *ngIf="customStyledColumns.indexOf(column.value) === -1">{{getLabelForField(column.value) | translate}}</th>
+            </ng-container>
+            <th *ngIf="isColumnDisplayed('path')">{{getLabelForField('path') | translate}}</th>
+            <th *ngIf="isColumnDisplayed('log_message')">{{getLabelForField('log_message') | translate}}</th>
+          </tr>
+        </thead>
         <tbody>
           <ng-container *ngFor="let log of logs; let i = index">
             <tr *ngIf="i === 0 || isDifferentDates(log.logtime, logs[i - 1].logtime)" class="log-date-row">
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less
index fe69a90..5d13bac 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.less
@@ -110,40 +110,45 @@
     background: none transparent;
   }
 
-  table td {
-    text-overflow: ellipsis;
-    overflow: hidden;
-    word-wrap: break-word;
-    &.log-action {
-      overflow: visible;
-      padding-left: .25em;
-      padding-right: 0;
-      width: 1em;
-      /deep/ .btn, /deep/ .filter-label {
-        font-size: 1em;
-        height: auto;
-        line-height: 1em;
-        padding: 0;
-      }
-    }
-    &.log-time {
-      min-width: 7em;
-      padding-left: 0;
-      text-align: right;
-    }
-    &.log-level {
+  table {
+    thead th {
       text-transform: uppercase;
-      min-width: 8em;
-      .log-colors;
-    }
-    &.log-type {
-      color: @link-color;
     }
-    &.log-message {
-      width: 100%;
-    }
-    &.log-event_count {
-      width: 3em;
+    td {
+      text-overflow: ellipsis;
+      overflow: hidden;
+      word-wrap: break-word;
+      &.log-action {
+        overflow: visible;
+        padding-left: .25em;
+        padding-right: 0;
+        width: 1em;
+        /deep/ .btn, /deep/ .filter-label {
+          font-size: 1em;
+          height: auto;
+          line-height: 1em;
+          padding: 0;
+        }
+      }
+      &.log-time {
+        min-width: 7em;
+        padding-left: 0;
+        text-align: right;
+      }
+      &.log-level {
+        text-transform: uppercase;
+        min-width: 8em;
+        .log-colors;
+      }
+      &.log-type {
+        color: @link-color;
+      }
+      &.log-message {
+        width: 100%;
+      }
+      &.log-event_count {
+        width: 3em;
+      }
     }
   }
 
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.ts b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.ts
index 7a5e94a..7dfb9af 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/service-logs-table/service-logs-table.component.ts
@@ -303,8 +303,8 @@ export class ServiceLogsTableComponent extends LogsTableComponent implements Aft
    * @returns {string}
    */
   private getLabelForField(field: string): string {
-    const column: ListItem = this.columns.find(column => column.value === field);
-    return column && column.label;
+    const column: ListItem = this.columns.find(currentColumn => currentColumn.value === field);
+    return column && (column.label || column.value);
   }
 
   /**