All files / src/app/components/configurations configurations.component.html

100% Statements 60/60
50% Branches 2/4
100% Functions 1/1
100% Lines 24/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 354x   490x   490x   203x   203x     4x 4x 4x 4x 4x 4x 4x   4x 475x 983x 983x 983x 33x 475x 33x   983x 983x 33x     4x  
<h1 class="title">Configurations</h1>
 
<app-loader *ngIf="!configurations"></app-loader>
 
<div class="container" *ngIf="configurations">
 
    <p-table [value]="configurations" [tableStyle]="{ 'min-width': '50rem' }" [paginator]="true" [rows]="rows" [totalRecords]="total"
        [rowsPerPageOptions]="filteredRowsPerPageOptions" [showCurrentPageReport]="true" [first]="offset" [lazy]="true" [lazyLoadOnInit]="false"
        currentPageReportTemplate="{first} - {last} of {totalRecords} configurations" [rowHover]="true" (onLazyLoad)="onTableEvent($event)">
        <ng-template pTemplate="header">
            <tr>
                <th pSortableColumn="config_id">Configuration ID <p-sortIcon field="config_id"></p-sortIcon></th>
                <th pSortableColumn="config.device_name">Device's name <p-sortIcon field="config.device_name"></p-sortIcon></th>
                <th pSortableColumn="config.target_device_id">Devices' IDs <p-sortIcon field="config.target_device_id"></p-sortIcon></th>
                <th pSortableColumn="is_in_use">In use <p-sortIcon field="is_in_use"></p-sortIcon></th>
                <th pSortableColumn="generated_at">Generatad at <p-sortIcon field="generated_at"></p-sortIcon></th>
                <th pSortableColumn="received_at">Received at <p-sortIcon field="received_at"></p-sortIcon></th>
            </tr>
        </ng-template>
        <ng-template pTemplate="body" let-configuration>
            <tr class="clickable" [routerLink]="['/configurations', configuration.config_id]">
                <td>#{{ configuration.config_id.slice(8) }}</td>
                <td>{{ configuration.config.device_name }}</td>
                <td>#{{ configuration.device_ids.join(" #") }}</td>
                <td>
                    <p-badge [value]="configuration.is_in_use ? 'yes' : 'no'" [severity]="configuration.is_in_use ? 'success' : 'danger' " />
                </td>
                <!-- This value is multiplied by 1000 to get javascript timestamps (otherway timestamp isn't converted to date correctly) -->
                <td>{{ (configuration.generated_at*1000) | date:'yyyy/MM/dd HH:mm:ss' }}</td>
                <td>{{ (configuration.received_at*1000) | date:'yyyy/MM/dd HH:mm:ss' }}</td>
            </tr>
        </ng-template>
    </p-table>
</div>