]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/system/jobs/jobs.component.html
Remove unnecessary onPage event on admin tables
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / system / jobs / jobs.component.html
CommitLineData
cd83ea1b 1<div class="admin-sub-header">
1061c73f 2 <div class="select-filter-block">
42712121 3 <label for="jobType" i18n>Job type</label>
1061c73f 4 <div class="peertube-select-container">
2bc9bd08 5 <select id="jobType" name="jobType" [(ngModel)]="jobType" (ngModelChange)="onJobStateOrTypeChanged()" class="form-control">
1061c73f
C
6 <option *ngFor="let jobType of jobTypes" [value]="jobType">{{ jobType }}</option>
7 </select>
8 </div>
9 </div>
10
11 <div class="select-filter-block">
42712121 12 <label for="jobState" i18n>Job state</label>
7f0d8561
RK
13 <ng-select
14 class="select-job-state"
15 [(ngModel)]="jobState"
16 (ngModelChange)="onJobStateOrTypeChanged()"
17 [clearable]="false"
18 [searchable]="false"
19 >
040d6896
RK
20 <ng-option value="all">
21 <span i18n="Selector for the list displaying jobs, filtering by their state">any</span>
22 </ng-option>
7f0d8561
RK
23 <ng-option *ngFor="let state of jobStates" [value]="state">
24 <span class="badge" [ngClass]="getJobStateClass(state)">{{ state }}</span>
25 </ng-option>
26 </ng-select>
94a5ff8a 27 </div>
83e74670
C
28
29 <div class="button-filter-block">
30 <my-button i18n-label label="Refresh" icon="refresh" (click)="refresh()"></my-button>
31 </div>
5cd80545 32</div>
cd83ea1b 33
ab998f7b 34<p-table
7f0d8561
RK
35 [value]="jobs" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
36 [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="uniqId" [first]="pagination.start"
e6492b2d 37 [tableStyle]="{'table-layout':'auto'}"
7f0d8561
RK
38 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
39 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} jobs"
e6492b2d 40 [expandedRowKeys]="expandedRows"
ab998f7b
C
41>
42 <ng-template pTemplate="header">
43 <tr>
b1f3b635 44 <th style="width: 40px"></th>
7f0d8561 45 <th style="width: calc(100% - 390px)" class="job-id" i18n>ID</th>
bc99dfe5 46 <th style="width: 200px" class="job-type" i18n>Type</th>
77d7e851 47 <th style="width: 200px" class="job-priority" i18n>Priority <small>(1 = highest priority)</small></th>
3b01f4c0 48 <th style="width: 200px" class="job-state" i18n *ngIf="jobState === 'all'">State</th>
e5830ac6 49 <th style="width: 100px" class="job-progress" i18n *ngIf="hasGlobalProgress()">Progress</th>
bc99dfe5 50 <th style="width: 150px" class="job-date" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
ab998f7b
C
51 </tr>
52 </ng-template>
94a5ff8a 53
ab998f7b 54 <ng-template pTemplate="body" let-expanded="expanded" let-job>
b1f3b635 55 <tr>
e4611b54
C
56 <td class="expand-cell" [pRowToggler]="job">
57 <my-table-expander-icon [expanded]="expanded"></my-table-expander-icon>
b1f3b635
C
58 </td>
59
040d6896
RK
60 <td class="job-id c-hand" [pRowToggler]="job" [title]="job.id">{{ job.id }}</td>
61 <td class="job-type c-hand" [pRowToggler]="job">{{ job.type }}</td>
77d7e851 62 <td class="job-priority c-hand" [pRowToggler]="job">{{ job.priority }}</td>
3b01f4c0
C
63
64 <td class="job-state c-hand" [pRowToggler]="job" *ngIf="jobState === 'all'">
040d6896
RK
65 <span class="badge" [ngClass]="getJobStateClass(job.state)">{{ job.state }}</span>
66 </td>
3b01f4c0 67
e5830ac6
C
68 <td class="job-progress c-hand" [pRowToggler]="job">
69 <ng-container *ngIf="hasProgress(job)">{{ getProgress(job) }}</ng-container>
3b01f4c0
C
70 </td>
71
040d6896 72 <td class="job-date c-hand" [pRowToggler]="job">{{ job.createdAt | date: 'short' }}</td>
ab998f7b
C
73 </tr>
74 </ng-template>
75
76 <ng-template pTemplate="rowexpansion" let-job>
77 <tr>
040d6896 78 <td [attr.colspan]="getColspan()">
42712121
JM
79 <pre>{{ [
80 'Job: ' + job.id,
81 'Type: ' + job.type,
82 'Processed on ' + (job.processedOn || '-'),
83 'Finished on ' + (job.finishedOn || '-')
84 ].join('\n') }}</pre>
85 </td>
86 </tr>
87 <tr>
040d6896 88 <td [attr.colspan]="getColspan()">
ab998f7b
C
89 <pre>{{ job.data }}</pre>
90 </td>
91 </tr>
c1953c56 92 <tr class="job-error" *ngIf="job.error">
040d6896 93 <td [attr.colspan]="getColspan()">
c1953c56
C
94 <pre>{{ job.error }}</pre>
95 </td>
96 </tr>
ab998f7b 97 </ng-template>
7f0d8561
RK
98
99 <ng-template pTemplate="emptymessage">
100 <tr>
040d6896 101 <td [attr.colspan]="getColspan()">
7f0d8561
RK
102 <div class="no-results">
103 <div class="d-block">
040d6896
RK
104 <ng-container *ngIf="jobState === 'all'">
105 <ng-container *ngIf="jobType === 'all'" i18n>No jobs found.</ng-container>
106 <ng-container *ngIf="jobType !== 'all'" i18n>No <code>{{ jobType }}</code> jobs found.</ng-container>
107 </ng-container>
d94b8ecf 108
3b01f4c0 109 <ng-container *ngIf="jobState !== 'all'">
040d6896
RK
110 <ng-container *ngIf="jobType === 'all'" i18n>No <span class="badge" [ngClass]="getJobStateClass(jobState)">{{ jobState }}</span> jobs found.</ng-container>
111 <ng-container *ngIf="jobType !== 'all'" i18n>No <code>{{ jobType }}</code> jobs found that are <span class="badge" [ngClass]="getJobStateClass(jobState)">{{ jobState }}</span>.</ng-container>
112 </ng-container>
7f0d8561
RK
113 </div>
114 </div>
115 </td>
116 </tr>
117 </ng-template>
ab998f7b 118</p-table>
94a5ff8a 119