aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html
blob: 2bc8ab3dd207b66748600f058c76fc7f43de65fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<div class="admin-sub-header">
  <div class="admin-sub-title">Jobs list</div>

  <div class="peertube-select-container">
    <select [(ngModel)]="jobState" (ngModelChange)="onJobStateChanged()">
      <option *ngFor="let state of jobStates" [value]="state">{{ state }}</option>
    </select>
  </div>
</div>

<p-table
  [value]="jobs" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="id"
  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
>
  <ng-template pTemplate="header">
    <tr>
      <th style="width: 27px"></th>
      <th style="width: 60px">ID</th>
      <th style="width: 210px">Type</th>
      <th style="width: 130px">State</th>
      <th style="width: 250px" pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
      <th style="width: 250px">Updated</th>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-expanded="expanded" let-job>
    <tr>
      <td>
        <span class="expander" [pRowToggler]="job">
          <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
        </span>
      </td>
      <td>{{ job.id }}</td>
      <td>{{ job.type }}</td>
      <td>{{ job.state }}</td>
      <td>{{ job.createdAt }}</td>
      <td>{{ job.updatedAt }}</td>
    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-job>
    <tr>
      <td colspan="6">
        <pre>{{ job.data }}</pre>
      </td>
    </tr>
    <tr class="job-error" *ngIf="job.error">
      <td colspan="6">
        <pre>{{ job.error }}</pre>
      </td>
    </tr>
  </ng-template>
</p-table>