diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-08-27 17:27:37 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-09-28 13:25:50 +0200 |
commit | 7f0d85616944681ed447f4342d86eee8141c7612 (patch) | |
tree | dc51b7dd989f7bcdff37ef1332a61d05a652ab53 /client/src/app/+admin/system/jobs/jobs.component.html | |
parent | cd372e840b6a291a56e0d5135548d05a98415155 (diff) | |
download | PeerTube-7f0d85616944681ed447f4342d86eee8141c7612.tar.gz PeerTube-7f0d85616944681ed447f4342d86eee8141c7612.tar.zst PeerTube-7f0d85616944681ed447f4342d86eee8141c7612.zip |
jobs/logs view select and empty state visual improvements
Diffstat (limited to 'client/src/app/+admin/system/jobs/jobs.component.html')
-rw-r--r-- | client/src/app/+admin/system/jobs/jobs.component.html | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/client/src/app/+admin/system/jobs/jobs.component.html b/client/src/app/+admin/system/jobs/jobs.component.html index 185fae220..e06156a9e 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.html +++ b/client/src/app/+admin/system/jobs/jobs.component.html | |||
@@ -10,45 +10,48 @@ | |||
10 | 10 | ||
11 | <div class="select-filter-block"> | 11 | <div class="select-filter-block"> |
12 | <label for="jobState" i18n>Job state</label> | 12 | <label for="jobState" i18n>Job state</label> |
13 | <div class="peertube-select-container"> | 13 | <ng-select |
14 | <select id="jobState" name="jobState" [(ngModel)]="jobState" (ngModelChange)="onJobStateOrTypeChanged()" class="form-control"> | 14 | class="select-job-state" |
15 | <option *ngFor="let state of jobStates" [value]="state">{{ state }}</option> | 15 | [(ngModel)]="jobState" |
16 | </select> | 16 | (ngModelChange)="onJobStateOrTypeChanged()" |
17 | </div> | 17 | [clearable]="false" |
18 | [searchable]="false" | ||
19 | > | ||
20 | <ng-option *ngFor="let state of jobStates" [value]="state"> | ||
21 | <span class="badge" [ngClass]="getJobStateClass(state)">{{ state }}</span> | ||
22 | </ng-option> | ||
23 | </ng-select> | ||
18 | </div> | 24 | </div> |
19 | </div> | 25 | </div> |
20 | 26 | ||
21 | <p-table | 27 | <p-table |
22 | [value]="jobs" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="uniqId" | 28 | [value]="jobs" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" |
23 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" [first]="pagination.start" | 29 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="uniqId" [first]="pagination.start" |
24 | [tableStyle]="{'table-layout':'auto'}" (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" | 30 | [tableStyle]="{'table-layout':'auto'}" (onPage)="onPage($event)" |
31 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | ||
32 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} jobs" | ||
33 | (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" | ||
25 | > | 34 | > |
26 | <ng-template pTemplate="header"> | 35 | <ng-template pTemplate="header"> |
27 | <tr> | 36 | <tr> |
28 | <th style="width: 40px"></th> | 37 | <th style="width: 40px"></th> |
29 | <th style="width: 100%" class="job-id" i18n>ID</th> | 38 | <th style="width: calc(100% - 390px)" class="job-id" i18n>ID</th> |
30 | <th style="width: 200px" class="job-type" i18n>Type</th> | 39 | <th style="width: 200px" class="job-type" i18n>Type</th> |
31 | <th style="width: 150px" class="job-date" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | 40 | <th style="width: 150px" class="job-date" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> |
32 | <th style="width: 150px" class="job-state" i18n>State</th> | ||
33 | </tr> | 41 | </tr> |
34 | </ng-template> | 42 | </ng-template> |
35 | 43 | ||
36 | <ng-template pTemplate="body" let-expanded="expanded" let-job> | 44 | <ng-template pTemplate="body" let-expanded="expanded" let-job> |
37 | <tr> | 45 | <tr> |
38 | <td class="expand-cell"> | 46 | <td class="expand-cell" [pRowToggler]="job" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> |
39 | <span class="expander" [pRowToggler]="job" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> | 47 | <span class="expander"> |
40 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | 48 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> |
41 | </span> | 49 | </span> |
42 | </td> | 50 | </td> |
43 | 51 | ||
44 | <td class="job-id" [title]="job.id">{{ job.id }}</td> | 52 | <td class="job-id" [pRowToggler]="job" [title]="job.id">{{ job.id }}</td> |
45 | <td class="job-type">{{ job.type }}</td> | 53 | <td class="job-type" [pRowToggler]="job">{{ job.type }}</td> |
46 | <td class="job-date">{{ job.createdAt | date: 'short' }}</td> | 54 | <td class="job-date" [pRowToggler]="job">{{ job.createdAt | date: 'short' }}</td> |
47 | <td class="job-state" *ngIf="job.state === 'delayed'" class="text-muted"><span class="glyphicon glyphicon-repeat"></span> <span i18n>Delayed</span></td> | ||
48 | <td class="job-state" *ngIf="job.state === 'waiting'" class="text-warning"><span class="glyphicon glyphicon-hourglass"></span> <span i18n>Will start soon...</span></td> | ||
49 | <td class="job-state" *ngIf="job.state === 'active'" class="text-warning"><span class="glyphicon glyphicon-cog"></span> <span i18n>Running...</span></td> | ||
50 | <td class="job-state" *ngIf="job.state === 'completed'" class="text-success"><span class="glyphicon glyphicon-ok"></span> <span i18n>Finished</span></td> | ||
51 | <td class="job-state" *ngIf="job.state === 'failed'" class="text-danger"><span class="glyphicon glyphicon-remove"></span> <span i18n>Failed</span></td> | ||
52 | </tr> | 55 | </tr> |
53 | </ng-template> | 56 | </ng-template> |
54 | 57 | ||
@@ -74,5 +77,18 @@ | |||
74 | </td> | 77 | </td> |
75 | </tr> | 78 | </tr> |
76 | </ng-template> | 79 | </ng-template> |
80 | |||
81 | <ng-template pTemplate="emptymessage"> | ||
82 | <tr> | ||
83 | <td colspan="4"> | ||
84 | <div class="no-results"> | ||
85 | <div class="d-block"> | ||
86 | <ng-container *ngIf="jobType === 'all'" i18n>No <span class="badge" [ngClass]="getJobStateClass(jobState)">{{ jobState }}</span> jobs found.</ng-container> | ||
87 | <ng-container *ngIf="jobType !== 'all'" i18n>No <code>{{ jobType }}</code> jobs found that are <span class="badge" [ngClass]="getJobStateClass(jobState)">{{ jobState }}</span>.</ng-container> | ||
88 | </div> | ||
89 | </div> | ||
90 | </td> | ||
91 | </tr> | ||
92 | </ng-template> | ||
77 | </p-table> | 93 | </p-table> |
78 | 94 | ||