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<mat-tab-group>
16  <mat-tab label="Lab">
17    <div class="mat-elevation-z2 entity-table">
18      <mat-table #table [dataSource]="labDataSource">
19        <!-- Index Column -->
20        <ng-container matColumnDef="_index">
21          <mat-header-cell *matHeaderCellDef class="index-column">No.</mat-header-cell>
22          <mat-cell *matCellDef="let i = index" class="index-column"> {{i+1+pageSize*labPageIndex}} </mat-cell>
23        </ng-container>
24
25        <!-- Name Column -->
26        <ng-container matColumnDef="name">
27          <mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
28          <mat-cell *matCellDef="let lab"> {{lab.name}} </mat-cell>
29        </ng-container>
30
31        <!-- Owner Column -->
32        <ng-container matColumnDef="owner">
33          <mat-header-cell *matHeaderCellDef>Owner</mat-header-cell>
34          <mat-cell *matCellDef="let lab"> {{lab.owner}} </mat-cell>
35        </ng-container>
36
37        <!-- Admin Column -->
38        <ng-container matColumnDef="admin">
39          <mat-header-cell *matHeaderCellDef>Admin</mat-header-cell>
40          <mat-cell *matCellDef="let lab"> {{lab.admin ? lab.admin.join(", ") : "None"}} </mat-cell>
41        </ng-container>
42
43        <!-- Host Count Column -->
44        <ng-container matColumnDef="hostCount">
45          <mat-header-cell *matHeaderCellDef># of Host</mat-header-cell>
46          <mat-cell *matCellDef="let lab"> {{ lab.hosts.length }} </mat-cell>
47        </ng-container>
48
49        <mat-header-row *matHeaderRowDef="labColumnTitles"></mat-header-row>
50        <mat-row *matRowDef="let row; columns: labColumnTitles;"></mat-row>
51      </mat-table>
52      <mat-paginator [length]="labCount"
53                     [pageSizeOptions]="pageSizeOptions"
54                     [pageIndex]="labPageIndex">
55      </mat-paginator>
56    </div>
57  </mat-tab>
58  <mat-tab label="Host">
59    <div class="mat-elevation-z2 entity-table">
60      <mat-table #table [dataSource]="hostDataSource">
61        <!-- Index Column -->
62        <ng-container matColumnDef="_index">
63          <mat-header-cell *matHeaderCellDef class="index-column">No.</mat-header-cell>
64          <mat-cell *matCellDef="let i = index" class="index-column"> {{i+1+pageSize*pageIndex}} </mat-cell>
65        </ng-container>
66
67        <!-- Lab Column -->
68        <ng-container matColumnDef="name">
69          <mat-header-cell *matHeaderCellDef>Lab</mat-header-cell>
70          <mat-cell *matCellDef="let host"> {{host.name}} </mat-cell>
71        </ng-container>
72
73        <!-- Hostname Column -->
74        <ng-container matColumnDef="hostname">
75          <mat-header-cell *matHeaderCellDef>Hostname</mat-header-cell>
76          <mat-cell *matCellDef="let host"> {{host.hostname}} </mat-cell>
77        </ng-container>
78
79        <!-- IP Column -->
80        <ng-container matColumnDef="ip">
81          <mat-header-cell *matHeaderCellDef>IP</mat-header-cell>
82          <mat-cell *matCellDef="let host"> {{host.ip}} </mat-cell>
83        </ng-container>
84
85        <!-- Host Equipment Column -->
86        <ng-container matColumnDef="host_equipment">
87          <mat-header-cell *matHeaderCellDef>Equipment</mat-header-cell>
88          <mat-cell *matCellDef="let host"> {{host.host_equipment}} </mat-cell>
89        </ng-container>
90
91        <!-- Version Column -->
92        <ng-container matColumnDef="vtslab_version">
93          <mat-header-cell *matHeaderCellDef>Version</mat-header-cell>
94          <mat-cell *matCellDef="let host"> {{host.vtslab_version}} </mat-cell>
95        </ng-container>
96
97        <mat-header-row *matHeaderRowDef="hostColumnTitles"></mat-header-row>
98        <mat-row *matRowDef="let row; columns: hostColumnTitles;"></mat-row>
99      </mat-table>
100      <mat-paginator [length]="count"
101                     [pageSizeOptions]="pageSizeOptions"
102                     [pageIndex]="labPageIndex">
103      </mat-paginator>
104    </div>
105  </mat-tab>
106</mat-tab-group>
107<div class="loading-spinner" *ngIf="loading">
108  <mat-spinner color="primary"></mat-spinner>
109</div>
110