• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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">
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    <!-- Test Name Column -->
27    <ng-container matColumnDef="test_name">
28      <mat-header-cell *matHeaderCellDef>Test Name</mat-header-cell>
29      <mat-cell *matCellDef="let schedule"> {{schedule.test_name}} </mat-cell>
30    </ng-container>
31
32    <!-- Device Column -->
33    <ng-container matColumnDef="device">
34      <mat-header-cell *matHeaderCellDef>Device</mat-header-cell>
35      <mat-cell *matCellDef="let schedule"> {{schedule.device ? schedule.device.join('\n') : ""}} </mat-cell>
36    </ng-container>
37
38    <!-- Manifest Branch Column -->
39    <ng-container matColumnDef="manifest_branch">
40      <mat-header-cell *matHeaderCellDef>Manifest Branch</mat-header-cell>
41      <mat-cell *matCellDef="let schedule"> {{schedule.manifest_branch}}</mat-cell>
42    </ng-container>
43
44    <!-- Build Target Column -->
45    <ng-container matColumnDef="build_target">
46      <mat-header-cell *matHeaderCellDef>Build Target</mat-header-cell>
47      <mat-cell *matCellDef="let schedule"> {{schedule.build_target}} </mat-cell>
48    </ng-container>
49
50    <!-- GSI Branch Column -->
51    <ng-container matColumnDef="gsi_branch">
52      <mat-header-cell *matHeaderCellDef>GSI Branch</mat-header-cell>
53      <mat-cell *matCellDef="let schedule"> {{schedule.gsi_branch}} </mat-cell>
54    </ng-container>
55
56    <!-- GSI Build Target Column -->
57    <ng-container matColumnDef="gsi_build_target">
58      <mat-header-cell *matHeaderCellDef>GSI Build Target</mat-header-cell>
59      <mat-cell *matCellDef="let schedule"> {{schedule.gsi_build_target}} </mat-cell>
60    </ng-container>
61
62    <!-- Test Branch Column -->
63    <ng-container matColumnDef="test_branch">
64      <mat-header-cell *matHeaderCellDef>Test Branch</mat-header-cell>
65      <mat-cell *matCellDef="let schedule"> {{schedule.test_branch}} </mat-cell>
66    </ng-container>
67
68    <!-- Test Build Target Column -->
69    <ng-container matColumnDef="test_build_target">
70      <mat-header-cell *matHeaderCellDef>Test Build Target</mat-header-cell>
71      <mat-cell *matCellDef="let schedule"> {{schedule.test_build_target}}</mat-cell>
72    </ng-container>
73
74    <!-- Period Column -->
75    <ng-container matColumnDef="period">
76      <mat-header-cell *matHeaderCellDef>Period</mat-header-cell>
77      <mat-cell *matCellDef="let schedule"> {{schedule.period}}</mat-cell>
78    </ng-container>
79
80    <!-- Status Column -->
81    <ng-container matColumnDef="status">
82      <mat-header-cell *matHeaderCellDef>Status</mat-header-cell>
83      <mat-cell *matCellDef="let schedule"
84                [ngStyle]="{color: (schedule.suspended || isExpired(schedule.timestamp)) ? '#FF0000' : '#000000'}">
85        {{schedule.suspended ? "Suspended" : (isExpired(schedule.timestamp) ? "Expired" : "Active")}}
86      </mat-cell>
87    </ng-container>
88
89    <!-- Timestamp Column -->
90    <ng-container matColumnDef="timestamp">
91      <mat-header-cell *matHeaderCellDef>Timestamp</mat-header-cell>
92      <mat-cell *matCellDef="let schedule"> {{getRelativeTime(schedule.timestamp)}}</mat-cell>
93    </ng-container>
94
95    <mat-header-row *matHeaderRowDef="columnTitles"></mat-header-row>
96    <mat-row *matRowDef="let row; columns: columnTitles;"
97             matRipple
98             class="element-row"
99             [appCdkDetailRow]="row" [appCdkDetailRowTpl]="schedule_detail"></mat-row>
100  </mat-table>
101
102  <mat-paginator [length]="count"
103                 [pageSize]="pageSize"
104                 [pageSizeOptions]="pageSizeOptions"
105                 [pageIndex]="pageIndex"
106                 (page)="pageEvent = onPageEvent($event)">
107  </mat-paginator>
108</div>
109<ng-template #schedule_detail let-schedule>
110  <div class="mat-row div-expandable" [@detailExpand] style="overflow: hidden">
111    <button mat-raised-button (click)="suspendSchedule([{urlsafe_key: schedule.urlsafe_key, suspend: !schedule.suspended}])">
112      {{(schedule.suspended ? "Resume" : "Suspend")}}
113    </button>
114    <button mat-raised-button (click)="onShowDetailsClicked(schedule)">
115      Show Details
116    </button>
117  </div>
118</ng-template>
119<div class="loading-spinner" *ngIf="loading">
120  <mat-spinner color="primary"></mat-spinner>
121</div>
122