Skip to content

Commit

Permalink
Defences - device list - Convert to new table
Browse files Browse the repository at this point in the history
Patches page and Device Defences page
issue primefaces#51
  • Loading branch information
atretyak1985 committed Nov 30, 2018
1 parent 1c9a4cd commit 3058042
Show file tree
Hide file tree
Showing 5 changed files with 453 additions and 207 deletions.
63 changes: 33 additions & 30 deletions src/organization/device/device_list_by_defences.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<org-navigator [mainNavbarEnabled]="false"></org-navigator>

<div class="flex-container">
<side-filter (onFilterChange)="updateProfileFilters($event)">
<side-filter #filterPanel (onFilterChange)="updateProfileFilters($event)">
<context-filter-section #section (clearSectionEvent)="clearContextFilter($event)">
<text-filter (filterChanged)="filterChanged($event)" key="hostname" label="Search" placeholder="All Hostnames"></text-filter>
<div class="input-container flex-container-column">
Expand Down Expand Up @@ -30,36 +30,39 @@ <h1 class="panel-title">
<p>There is currently nothing to display.</p>
</div>

<div class="infinite-scroll">
<div class="table-responsive" [class.nanitor-hide]="!items">
<sortable-table class="device-table" (sortingChanged)="sortingChanged($event)">
<div class="flex-table">
<div class="flex-table-row thead">
<div class="flex-table-item md"><sortable-column sortBy="hostname">Hostname</sortable-column></div>
<div class="flex-table-item md"><sortable-column sortBy="type">Device Type</sortable-column></div>
<div class="flex-table-item md"><sortable-column sortBy="platform_description">OS</sortable-column></div>
<div class="flex-table-item md text-center"><sortable-column sortBy="num_patches">Security Patches Missing</sortable-column></div>
<div class="flex-table-item md text-center"><sortable-column sortBy="av_status">AntiVirus Status</sortable-column></div>
<div class="flex-table-item md text-center"><sortable-column sortBy="firewall_status">Firewall Status</sortable-column></div>
<div class="flex-table-item md text-center"><sortable-column sortBy="sysdrive_encryption_status">Disk Encryption</sortable-column></div>
<div class="flex-table-item md"><sortable-column sortBy="last_activity_at">Last Activity</sortable-column></div>
<p-table #ptable class="p-table" [columns]="cols" [value]="items" [lazy]="true" (onLazyLoad)="sortingChanged($event)" [paginator]="true"
[rows]="ROWS" [totalRecords]="totalRecords" scrollable="true" [scrollHeight]="window.innerHeight - HEADER_HEIGHT + 'px'" [customSort]="true" sortMode="multiple"
[style]="{width: window.innerWidth - (filterPanel.isCollapsed ? LIST_BASE_PADDING : LIST_BASE_PADDING + FILTER_WIDTH) + 'px'}"
(sortFunction)="sortingChanged($event)" (onPage)="onPage($event)">
<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>
<div >
<div id="item-{{ item.id }}" class="flex-table-row tbody" *ngFor="let item of items" [attr.item-id]="item.id">
<div class="flex-table-item md"><a href="#" (click)="itemSelected($event, item)">{{ item.hostname }}</a></div>
<div class="flex-table-item md">{{ typeToString(item.type, item.system_type) }}</div>
<div class="flex-table-item md">{{ item.os_description }} {{ item.dist_version }}</div>
<div class="flex-table-item md text-center">{{ item.num_patches|mynumber }}</div>
<div class="flex-table-item md text-center">{{ avStatusToString(item.av_status) }}</div>
<div class="flex-table-item md text-center">{{ firewallStatusToString(item.firewall_status) }}</div>
<div class="flex-table-item md text-center" >{{ driveEncryptionStatusToString(item.sysdrive_encryption_status) }}</div>
<div class="flex-table-item md">{{ item.last_activity_at*1000 | moment:'MMM Do YYYY HH:mm' }}</div>
</div>
</div>
</div>
</sortable-table>
</div>
</div>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns">
<tr id="item-{{ rowData.id }}" class="table-row" [ngClass]="{'disabled': rowData.archived}">
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('hostname')}">
<a href="#" (click)="itemSelected($event, rowData)">{{ rowData.hostname }}</a>
</td>
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('type')}">{{ typeToString(rowData.type, rowData.system_type) }}</td>
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('platform_description')}">{{ rowData.os_description }} {{ rowData.dist_version }}</td>
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('num_patches')}">{{ rowData.num_patches|mynumber }}</td>
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('av_status')}">{{ avStatusToString(rowData.av_status) }}</td>
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('firewall_status')}">{{ firewallStatusToString(rowData.firewall_status) }}</td>
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('sysdrive_encryption_status')}">{{ driveEncryptionStatusToString(rowData.sysdrive_encryption_status) }}</td>
<td class="table-cell" [ngStyle]="{'width': getColumnWidth('last_activity_at')}">{{ rowData.last_activity_at*1000 | moment:'MMM Do YYYY HH:mm' }}</td>
</tr>
</ng-template>
</p-table>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 3058042

Please sign in to comment.