forked from primefaces/primeng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request primefaces#390 from atretyak1985/issue_#NNTR-349
[NNTR-349]Asset details -> Activity log, remove parenthesis from the item.
- Loading branch information
Showing
5 changed files
with
65 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 56 additions & 49 deletions
105
src/organization/device/detail/activity_log/device-activity_log.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,56 @@ | ||
<p-table #ptable class="p-table" [columns]="cols" [value]="items" [paginator]="true" [rows]="ROWS" | ||
[totalRecords]="totalRecords" scrollable="true" [scrollHeight]="listHeight" sortMode="multiple" [lazy]="true" | ||
(onLazyLoad)="sortingChanged($event)" (onPage)="onPage()"> | ||
<ng-template pTemplate="colgroup" let-columns> | ||
<colgroup> | ||
<col *ngFor="let col of columns" [ngStyle]="{'width': col.width}"> | ||
</colgroup> | ||
</ng-template> | ||
<ng-template pTemplate="header" let-columns> | ||
<tr valign="top" class="defence" width="100%"> | ||
<th *ngFor="let col of columns" class="table-header-cell" [pSortableColumn]="col.field" [ngStyle]="{'width': col.width}"> | ||
<div>{{col.header}} | ||
<p-sortIcon [field]="col.field"></p-sortIcon> | ||
</div> | ||
</th> | ||
</tr> | ||
</ng-template> | ||
<ng-template pTemplate="body" let-rowData let-columns="columns"> | ||
<tr #row id="item-{{ rowData.id }}" class="table-row" [ngClass]="{'flash-row': flashRow && row.id === 'item-' + selectedId }"> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('time')}"> | ||
{{ rowData.time*1000 | moment:"MMM Do YYYY HH:mm" }} | ||
</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('event_type')}">{{ rowData.event_type|titlecase }}</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('event_trigger')}">{{ rowData.event_trigger|titlecase }}</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('event_name')}"> | ||
<h2>{{ rowData.event_name }}</h2> | ||
{{ rowData.message }} | ||
<ul class="event-data"> | ||
<li *ngFor="let item of eventData(rowData.event_data)"> | ||
<b>{{item.key}}:</b> | ||
<span *ngIf="typeOf(item.value) == 'other'"> {{item.value}}</span> | ||
<span *ngIf="typeOf(item.value) == 'array'"> {{joinArray(item.value)}}</span> | ||
<ul *ngIf="typeOf(item.value) == 'object'" class="event-data"> | ||
<li *ngFor="let subitem of eventData(item.value)"> | ||
<b>{{subitem.key}}:</b> {{subitem.value}} | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('severity')}">{{ stringUtils.eventSeverityToString(rowData.severity) }}</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('hostname')}"> | ||
<a *ngIf="rowData.device_id" href="#" (click)="itemSelected($event, rowData, true)">{{ rowData.hostname }}</a> | ||
<span *ngIf="!rowData.device_id">{{ rowData.hostname }}</span> | ||
</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('address')}">{{ rowData.address }}</td> | ||
</tr> | ||
</ng-template> | ||
</p-table> | ||
<ng-container> | ||
<div class="no-data" *ngIf="emptyResponse"> | ||
<p>There is currently nothing to display.</p> | ||
</div> | ||
</ng-container> | ||
<ng-container *ngIf="!emptyResponse"> | ||
<p-table #ptable class="p-table" [columns]="cols" [value]="items" [paginator]="true" [rows]="ROWS" | ||
[totalRecords]="totalRecords" scrollable="true" [scrollHeight]="listHeight" sortMode="multiple" [lazy]="true" | ||
(onLazyLoad)="sortingChanged($event)" (onPage)="onPage()"> | ||
<ng-template pTemplate="colgroup" let-columns> | ||
<colgroup> | ||
<col *ngFor="let col of columns" [ngStyle]="{'width': col.width}"> | ||
</colgroup> | ||
</ng-template> | ||
<ng-template pTemplate="header" let-columns> | ||
<tr valign="top" class="defence" width="100%"> | ||
<th *ngFor="let col of columns" class="table-header-cell" [pSortableColumn]="col.field" [ngStyle]="{'width': col.width}"> | ||
<div>{{col.header}} | ||
<p-sortIcon [field]="col.field"></p-sortIcon> | ||
</div> | ||
</th> | ||
</tr> | ||
</ng-template> | ||
<ng-template pTemplate="body" let-rowData let-columns="columns"> | ||
<tr #row id="item-{{ rowData.id }}" class="table-row" [ngClass]="{'flash-row': flashRow && row.id === 'item-' + selectedId }"> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('time')}"> | ||
{{ rowData.time*1000 | moment:"MMM Do YYYY HH:mm" }} | ||
</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('event_type')}">{{ rowData.event_type|titlecase }}</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('event_trigger')}">{{ rowData.event_trigger|titlecase }}</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('event_name')}"> | ||
<h2>{{ rowData.event_name }}</h2> | ||
{{ rowData.message }} | ||
<ul class="event-data"> | ||
<li *ngFor="let item of eventData(rowData.event_data)"> | ||
<b>{{item.key}}:</b> | ||
<span *ngIf="typeOf(item.value) == 'other'"> {{item.value}}</span> | ||
<span *ngIf="typeOf(item.value) == 'array'"> {{joinArray(item.value)}}</span> | ||
<ul *ngIf="typeOf(item.value) == 'object'" class="event-data"> | ||
<li *ngFor="let subitem of eventData(item.value)"> | ||
<b>{{subitem.key}}:</b> {{subitem.value}} | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('severity')}">{{ stringUtils.eventSeverityToString(rowData.severity) }}</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('hostname')}"> | ||
<a *ngIf="rowData.device_id" href="#" (click)="itemSelected($event, rowData, true)">{{ rowData.hostname }}</a> | ||
<span *ngIf="!rowData.device_id">{{ rowData.hostname }}</span> | ||
</td> | ||
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('address')}">{{ rowData.address }}</td> | ||
</tr> | ||
</ng-template> | ||
</p-table> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters