From 94831479f5facff9469540a3d49dd347b88bdf5a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 10 Jul 2018 17:02:20 +0200 Subject: Migrate to bull --- .../src/app/+admin/jobs/jobs-list/jobs-list.component.html | 12 +++++++----- client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts | 4 ++-- client/src/app/+admin/jobs/shared/job.service.ts | 9 ++++++++- 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'client/src/app/+admin/jobs') 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 @@ @@ -19,7 +19,8 @@ Type State Created - Updated + Processed on + Finished on @@ -34,18 +35,19 @@ {{ job.type }} {{ job.state }} {{ job.createdAt }} - {{ job.updatedAt }} + {{ job.processedOn }} + {{ job.finishedOn }} - +
{{ job.data }}
- +
{{ job.error }}
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' export class JobsListComponent extends RestTable implements OnInit { private static JOB_STATE_LOCAL_STORAGE_STATE = 'jobs-list-state' - jobState: JobState = 'inactive' - jobStates: JobState[] = [ 'active', 'complete', 'failed', 'inactive', 'delayed' ] + jobState: JobState = 'waiting' + jobStates: JobState[] = [ 'active', 'completed', 'failed', 'waiting', 'delayed' ] jobs: Job[] = [] totalRecords: number 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 { return this.authHttp.get>(JobService.BASE_JOB_URL + '/' + state, { params }) .pipe( - map(res => this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'updatedAt' ])), + map(res => { + return this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'processedOn', 'finishedOn' ]) + }), map(res => this.restExtractor.applyToResultListData(res, this.prettyPrintData)), + map(res => this.restExtractor.applyToResultListData(res, this.buildUniqId)), catchError(err => this.restExtractor.handleError(err)) ) } @@ -36,4 +39,8 @@ export class JobService { return Object.assign(obj, { data }) } + + private buildUniqId (obj: Job) { + return Object.assign(obj, { uniqId: `${obj.id}-${obj.type}` }) + } } -- cgit v1.2.3