diff options
Diffstat (limited to 'client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts')
-rw-r--r-- | client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts | 11 |
1 files changed, 9 insertions, 2 deletions
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 f93847f29..7de6f70d2 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 | |||
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core' | |||
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { NotificationsService } from 'angular2-notifications' |
3 | import { SortMeta } from 'primeng/primeng' | 3 | import { SortMeta } from 'primeng/primeng' |
4 | import { Job } from '../../../../../../shared/index' | 4 | import { Job } from '../../../../../../shared/index' |
5 | import { JobState } from '../../../../../../shared/models' | ||
5 | import { RestPagination, RestTable } from '../../../shared' | 6 | import { RestPagination, RestTable } from '../../../shared' |
6 | import { viewportHeight } from '../../../shared/misc/utils' | 7 | import { viewportHeight } from '../../../shared/misc/utils' |
7 | import { JobService } from '../shared' | 8 | import { JobService } from '../shared' |
@@ -13,10 +14,12 @@ import { RestExtractor } from '../../../shared/rest/rest-extractor.service' | |||
13 | styleUrls: [ './jobs-list.component.scss' ] | 14 | styleUrls: [ './jobs-list.component.scss' ] |
14 | }) | 15 | }) |
15 | export class JobsListComponent extends RestTable implements OnInit { | 16 | export class JobsListComponent extends RestTable implements OnInit { |
17 | jobState: JobState = 'inactive' | ||
18 | jobStates: JobState[] = [ 'active', 'complete', 'failed', 'inactive', 'delayed' ] | ||
16 | jobs: Job[] = [] | 19 | jobs: Job[] = [] |
17 | totalRecords = 0 | 20 | totalRecords = 0 |
18 | rowsPerPage = 20 | 21 | rowsPerPage = 20 |
19 | sort: SortMeta = { field: 'createdAt', order: 1 } | 22 | sort: SortMeta = { field: 'createdAt', order: -1 } |
20 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
21 | scrollHeight = '' | 24 | scrollHeight = '' |
22 | 25 | ||
@@ -33,9 +36,13 @@ export class JobsListComponent extends RestTable implements OnInit { | |||
33 | this.scrollHeight = (viewportHeight() - 380) + 'px' | 36 | this.scrollHeight = (viewportHeight() - 380) + 'px' |
34 | } | 37 | } |
35 | 38 | ||
39 | onJobStateChanged () { | ||
40 | this.loadData() | ||
41 | } | ||
42 | |||
36 | protected loadData () { | 43 | protected loadData () { |
37 | this.jobsService | 44 | this.jobsService |
38 | .getJobs(this.pagination, this.sort) | 45 | .getJobs(this.jobState, this.pagination, this.sort) |
39 | .subscribe( | 46 | .subscribe( |
40 | resultList => { | 47 | resultList => { |
41 | this.jobs = resultList.data | 48 | this.jobs = resultList.data |