1<!-- Copyright (C) 2018 The Android Open Source Project
2
3     Licensed under the Apache License, Version 2.0 (the "License");
4     you may not use this file except in compliance with the License.
5     You may obtain a copy of the License at
6
7          http://www.apache.org/licenses/LICENSE-2.0
8
9     Unless required by applicable law or agreed to in writing, software
10     distributed under the License is distributed on an "AS IS" BASIS,
11     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12     See the License for the specific language governing permissions and
13     limitations under the License.
14-->
15<div class="entity-filter">
16  <app-filter (applyFilters)="applyFilters($event)" [disabled]="loading"></app-filter>
17</div>
18<div class="mat-elevation-z2 entity-table" [ngStyle]="{'opacity': (loading) ? 0.2 : 1 }">
19  <mat-table [dataSource]="dataSource" matSort matSortActive="hostname" matSortDirection="asc">
20    <!-- Index Column -->
21    <ng-container matColumnDef="_index">
22      <mat-header-cell *matHeaderCellDef>No.</mat-header-cell>
23      <mat-cell *matCellDef="let i = index"> {{i+1+pageSize*pageIndex}} </mat-cell>
24    </ng-container>
25
26    <!-- Host Name Column -->
27    <ng-container matColumnDef="hostname">
28      <mat-header-cell *matHeaderCellDef mat-sort-header disabled>Host Name</mat-header-cell>
29      <mat-cell *matCellDef="let device"> {{device.hostname}} </mat-cell>
30    </ng-container>
31
32    <!-- Product Column -->
33    <ng-container matColumnDef="product">
34      <mat-header-cell *matHeaderCellDef>Product</mat-header-cell>
35      <mat-cell *matCellDef="let device"> {{device.product}} </mat-cell>
36    </ng-container>
37
38    <!-- Serial Column -->
39    <ng-container matColumnDef="serial">
40      <mat-header-cell *matHeaderCellDef>Serial</mat-header-cell>
41      <mat-cell *matCellDef="let device"> {{device.serial}} </mat-cell>
42    </ng-container>
43
44    <!-- Status Column -->
45    <ng-container matColumnDef="status">
46      <mat-header-cell *matHeaderCellDef>Status</mat-header-cell>
47      <mat-cell *matCellDef="let device"> {{deviceStatusEnum[device.status]}} </mat-cell>
48    </ng-container>
49
50    <!-- Scheduling Status Column -->
51    <ng-container matColumnDef="scheduling_status">
52      <mat-header-cell *matHeaderCellDef>Scheduling Status</mat-header-cell>
53      <mat-cell *matCellDef="let device"> {{schedulingStatusEnum[device.scheduling_status]}} </mat-cell>
54    </ng-container>
55
56    <!-- Equipment Column -->
57    <ng-container matColumnDef="device_equipment">
58      <mat-header-cell *matHeaderCellDef>Equipment</mat-header-cell>
59      <mat-cell *matCellDef="let device"> {{device.device_equipment ? device.device_equipment.join(", ") : "None"}} </mat-cell>
60    </ng-container>
61
62    <!-- Timestamp Column -->
63    <ng-container matColumnDef="timestamp">
64      <mat-header-cell *matHeaderCellDef>Timestamp</mat-header-cell>
65      <mat-cell *matCellDef="let device">{{getRelativeTime(device.timestamp)}}</mat-cell>
66    </ng-container>
67
68    <mat-header-row *matHeaderRowDef="columnTitles"></mat-header-row>
69    <mat-row *matRowDef="let row; columns: columnTitles;"></mat-row>
70  </mat-table>
71  <mat-paginator [length]="count"
72                 [pageSize]="pageSize"
73                 [pageSizeOptions]="pageSizeOptions"
74                 [pageIndex]="pageIndex"
75                 (page)="pageEvent = onPageEvent($event)">
76  </mat-paginator>
77</div>
78<div class="loading-spinner" *ngIf="loading">
79  <mat-spinner color="primary"></mat-spinner>
80</div>
81