aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-10 17:02:20 +0200
committerChocobozzz <me@florianbigard.com>2018-07-11 14:00:17 +0200
commit94831479f5facff9469540a3d49dd347b88bdf5a (patch)
tree4e8990fc4fded913952c732b6466b15fc52ab06d /client/src/app/+admin
parent2cdf27bae6acfaa0b99bb07555edc57f48b8bc43 (diff)
downloadPeerTube-94831479f5facff9469540a3d49dd347b88bdf5a.tar.gz
PeerTube-94831479f5facff9469540a3d49dd347b88bdf5a.tar.zst
PeerTube-94831479f5facff9469540a3d49dd347b88bdf5a.zip
Migrate to bull
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/jobs/jobs-list/jobs-list.component.html12
-rw-r--r--client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts4
-rw-r--r--client/src/app/+admin/jobs/shared/job.service.ts9
3 files changed, 17 insertions, 8 deletions
diff --git a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html
index 20c35cb5b..b52d026a7 100644
--- a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html
+++ b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html
@@ -9,7 +9,7 @@
9</div> 9</div>
10 10
11<p-table 11<p-table
12 [value]="jobs" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="id" 12 [value]="jobs" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="uniqId"
13 [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" 13 [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
14> 14>
15 <ng-template pTemplate="header"> 15 <ng-template pTemplate="header">
@@ -19,7 +19,8 @@
19 <th i18n style="width: 210px">Type</th> 19 <th i18n style="width: 210px">Type</th>
20 <th i18n style="width: 130px">State</th> 20 <th i18n style="width: 130px">State</th>
21 <th i18n style="width: 250px" pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> 21 <th i18n style="width: 250px" pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
22 <th i18n style="width: 250px">Updated</th> 22 <th i18n style="width: 250px">Processed on</th>
23 <th i18n style="width: 250px">Finished on</th>
23 </tr> 24 </tr>
24 </ng-template> 25 </ng-template>
25 26
@@ -34,18 +35,19 @@
34 <td>{{ job.type }}</td> 35 <td>{{ job.type }}</td>
35 <td>{{ job.state }}</td> 36 <td>{{ job.state }}</td>
36 <td>{{ job.createdAt }}</td> 37 <td>{{ job.createdAt }}</td>
37 <td>{{ job.updatedAt }}</td> 38 <td>{{ job.processedOn }}</td>
39 <td>{{ job.finishedOn }}</td>
38 </tr> 40 </tr>
39 </ng-template> 41 </ng-template>
40 42
41 <ng-template pTemplate="rowexpansion" let-job> 43 <ng-template pTemplate="rowexpansion" let-job>
42 <tr> 44 <tr>
43 <td colspan="6"> 45 <td colspan="7">
44 <pre>{{ job.data }}</pre> 46 <pre>{{ job.data }}</pre>
45 </td> 47 </td>
46 </tr> 48 </tr>
47 <tr class="job-error" *ngIf="job.error"> 49 <tr class="job-error" *ngIf="job.error">
48 <td colspan="6"> 50 <td colspan="7">
49 <pre>{{ job.error }}</pre> 51 <pre>{{ job.error }}</pre>
50 </td> 52 </td>
51 </tr> 53 </tr>
diff --git a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts
index 29dd9f31c..a77f4a4a1 100644
--- a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts
+++ b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts
@@ -17,8 +17,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
17export class JobsListComponent extends RestTable implements OnInit { 17export class JobsListComponent extends RestTable implements OnInit {
18 private static JOB_STATE_LOCAL_STORAGE_STATE = 'jobs-list-state' 18 private static JOB_STATE_LOCAL_STORAGE_STATE = 'jobs-list-state'
19 19
20 jobState: JobState = 'inactive' 20 jobState: JobState = 'waiting'
21 jobStates: JobState[] = [ 'active', 'complete', 'failed', 'inactive', 'delayed' ] 21 jobStates: JobState[] = [ 'active', 'completed', 'failed', 'waiting', 'delayed' ]
22 jobs: Job[] = [] 22 jobs: Job[] = []
23 totalRecords: number 23 totalRecords: number
24 rowsPerPage = 10 24 rowsPerPage = 10
diff --git a/client/src/app/+admin/jobs/shared/job.service.ts b/client/src/app/+admin/jobs/shared/job.service.ts
index 6441eaac1..b96dc3359 100644
--- a/client/src/app/+admin/jobs/shared/job.service.ts
+++ b/client/src/app/+admin/jobs/shared/job.service.ts
@@ -25,8 +25,11 @@ export class JobService {
25 25
26 return this.authHttp.get<ResultList<Job>>(JobService.BASE_JOB_URL + '/' + state, { params }) 26 return this.authHttp.get<ResultList<Job>>(JobService.BASE_JOB_URL + '/' + state, { params })
27 .pipe( 27 .pipe(
28 map(res => this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'updatedAt' ])), 28 map(res => {
29 return this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'processedOn', 'finishedOn' ])
30 }),
29 map(res => this.restExtractor.applyToResultListData(res, this.prettyPrintData)), 31 map(res => this.restExtractor.applyToResultListData(res, this.prettyPrintData)),
32 map(res => this.restExtractor.applyToResultListData(res, this.buildUniqId)),
30 catchError(err => this.restExtractor.handleError(err)) 33 catchError(err => this.restExtractor.handleError(err))
31 ) 34 )
32 } 35 }
@@ -36,4 +39,8 @@ export class JobService {
36 39
37 return Object.assign(obj, { data }) 40 return Object.assign(obj, { data })
38 } 41 }
42
43 private buildUniqId (obj: Job) {
44 return Object.assign(obj, { uniqId: `${obj.id}-${obj.type}` })
45 }
39} 46}