From f8a29a73306b0083c80884cf0a7ca0878a25a375 Mon Sep 17 00:00:00 2001 From: Harminder Singh Date: Thu, 2 May 2019 21:05:42 -0700 Subject: [PATCH] Placeholder for job status API --- .../system-management.component.ts | 22 +++++++++++++++++-- webapp/src/environments/environment.prod.ts | 4 ++++ webapp/src/environments/environment.stg.ts | 4 ++++ webapp/src/environments/environment.ts | 4 ++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/pacman-features/modules/admin/system-management/system-management.component.ts b/webapp/src/app/pacman-features/modules/admin/system-management/system-management.component.ts index f48022364..8d600ef3a 100644 --- a/webapp/src/app/pacman-features/modules/admin/system-management/system-management.component.ts +++ b/webapp/src/app/pacman-features/modules/admin/system-management/system-management.component.ts @@ -41,6 +41,7 @@ export class SystemManagementComponent implements OnInit, OnDestroy { errorVal = 0; modalTitle = 'Confirmation Required'; private systemSubscription: Subscription; + private systemStatusSubscription: Subscription; constructor( private commonResponseService: CommonResponseService, private router: Router, @@ -48,7 +49,20 @@ export class SystemManagementComponent implements OnInit, OnDestroy { private titleCasePipe: TitleCasePipe ) { } - ngOnInit() { + getJobStatus() { + const url = 'https://internal-pacbot-43782189.us-east-1.elb.amazonaws.com/api/admin/operations'; + const method = environment.systemJobStatus.method; + + this.systemStatusSubscription = this.commonResponseService + .getData(url, method, {}, {}).subscribe( + response => { + this.isCheckedRules = response[0].status; + this.isCheckedJobs = response[1].status; + }, + error => { + + } + ) } ontoggleAccess(e, selectToggle) { @@ -86,6 +100,7 @@ export class SystemManagementComponent implements OnInit, OnDestroy { this.showLoader = true; if (this.systemSubscription) { this.systemSubscription.unsubscribe(); + this.systemStatusSubscription.unsubscribe(); } const url = 'https://internal-pacbot-43782189.us-east-1.elb.amazonaws.com/api/admin/operations'; const method = environment.systemOperations.method; @@ -109,7 +124,6 @@ export class SystemManagementComponent implements OnInit, OnDestroy { this.showLoader = false; this.toggleBtnOnSuccess(jobType); } , error => { - console.log('error', error); this.errorVal = -1; this.modalTitle = 'Error'; this.showLoader = false; @@ -127,6 +141,10 @@ export class SystemManagementComponent implements OnInit, OnDestroy { } + ngOnInit() { + // this.getJobStatus(); + } + ngOnDestroy() { try { if (this.systemSubscription) { diff --git a/webapp/src/environments/environment.prod.ts b/webapp/src/environments/environment.prod.ts index 9fc61cd76..a1ece7178 100644 --- a/webapp/src/environments/environment.prod.ts +++ b/webapp/src/environments/environment.prod.ts @@ -813,6 +813,10 @@ export const environment = { systemOperations: { url: '{{baseUrl}}/admin/operations', method: 'POST' + }, + systemJobStatus: { + url: '{{baseUrl}}/admin/operations', + method: 'POST' } }; diff --git a/webapp/src/environments/environment.stg.ts b/webapp/src/environments/environment.stg.ts index 5600add02..ac29a168a 100644 --- a/webapp/src/environments/environment.stg.ts +++ b/webapp/src/environments/environment.stg.ts @@ -813,5 +813,9 @@ export const environment = { systemOperations: { url: '{{baseUrl}}/admin/operations', method: 'POST' + }, + systemJobStatus: { + url: '{{baseUrl}}/admin/operations', + method: 'POST' } }; diff --git a/webapp/src/environments/environment.ts b/webapp/src/environments/environment.ts index d987057c4..17b125075 100644 --- a/webapp/src/environments/environment.ts +++ b/webapp/src/environments/environment.ts @@ -813,5 +813,9 @@ export const environment = { systemOperations: { url: '{{baseUrl}}/admin/operations', method: 'POST' + }, + systemJobStatus: { + url: '{{baseUrl}}/admin/operations', + method: 'POST' } };