aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts
diff options
context:
space:
mode:
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.ts11
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'
2import { NotificationsService } from 'angular2-notifications' 2import { NotificationsService } from 'angular2-notifications'
3import { SortMeta } from 'primeng/primeng' 3import { SortMeta } from 'primeng/primeng'
4import { Job } from '../../../../../../shared/index' 4import { Job } from '../../../../../../shared/index'
5import { JobState } from '../../../../../../shared/models'
5import { RestPagination, RestTable } from '../../../shared' 6import { RestPagination, RestTable } from '../../../shared'
6import { viewportHeight } from '../../../shared/misc/utils' 7import { viewportHeight } from '../../../shared/misc/utils'
7import { JobService } from '../shared' 8import { 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})
15export class JobsListComponent extends RestTable implements OnInit { 16export 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