diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-09-29 15:27:50 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-09-29 15:27:55 +0800 |
commit | d59d5304f12591bd8d2d5c93e29b596b7b59e6c3 (patch) | |
tree | 0de5ccb82efcae9c8df40f398ddef39e1545707e /usecaseui-portal/src/app | |
parent | d936ec81029cd05c999a27898f29f4c37e7075aa (diff) |
bug:repair progress ccvpn/ns function Timer of service-list page
Change-Id: Ibc71010cd10ef2513e4cf76c9a381b1b0a2d8caf
Issue-ID: USECASEUI-306
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app')
-rw-r--r-- | usecaseui-portal/src/app/views/services/services-list/services-list.component.ts | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts b/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts index 8ce56ebf..b39c14e0 100644 --- a/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts +++ b/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts @@ -42,8 +42,10 @@ export class ServicesListComponent implements OnInit { }); } ngOnDestroy() { - clearInterval(this.progressOutTimer); - clearInterval(this.progressingTimer); + clearInterval(this.progressCcvpnOutTimer); + clearInterval(this.progressingCcvpnTimer); + clearInterval(this.progressNsOutTimer); + clearInterval(this.progressingNsTimer); } // customer servicetype isSol005Interface = false; @@ -87,13 +89,10 @@ export class ServicesListComponent implements OnInit { } ]; - requery; - progressOutTimer = setTimeout(() => { - this.requery(); - }, 10000); - progressingTimer = setTimeout(() => { - this.requery(); - }, 5000); + progressCcvpnOutTimer :any; // ccvpn¡¢NS progress Timer + progressingCcvpnTimer :any; + progressNsOutTimer :any; + progressingNsTimer :any; //The icon behind each row of data in the table expands iconMoreShow(data, tableData) { @@ -1302,7 +1301,7 @@ export class ServicesListComponent implements OnInit { let mypromise = new Promise((res, rej) => { let operationTypeObj = {operationType:obj.operationType}; let errorNums = 180; - this.requery = () => { + let requeryCcvpn = () => { this.myhttp.getProgress(obj,operationTypeObj) .subscribe((data) => { if (data.status == "FAILED") { @@ -1315,7 +1314,9 @@ export class ServicesListComponent implements OnInit { callback({ progress: 255, status: "time over" }); return false; } - this.progressOutTimer; + this.progressCcvpnOutTimer = setTimeout(()=>{ + requeryCcvpn(); + },10000); return false; } if (data.operationStatus.progress > 100) { @@ -1324,13 +1325,15 @@ export class ServicesListComponent implements OnInit { } if (data.operationStatus.progress < 100) { callback(data.operationStatus); - this.progressingTimer; + this.progressingCcvpnTimer = setTimeout(()=>{ + requeryCcvpn(); + },5000); } else { res(data.operationStatus); } }) } - this.requery(); + requeryCcvpn(); }) return mypromise; } @@ -1343,7 +1346,7 @@ export class ServicesListComponent implements OnInit { "serviceInstanceId":id, "operationType":operationType } - this.requery = () => { + let requeryNs = () => { this.myhttp.getNsProgress(jobid,paramsObj) .subscribe((data) => { if (data.status == "FAILED") { @@ -1356,7 +1359,9 @@ export class ServicesListComponent implements OnInit { callback({ progress: 255, status: "time over" }); return false; } - this.progressOutTimer; + this.progressNsOutTimer = setTimeout(()=>{ + requeryNs(); + },10000); return false; } if (data.responseDescriptor.progress > 100 && data.responseDescriptor.status == "error") { @@ -1365,13 +1370,15 @@ export class ServicesListComponent implements OnInit { } if (data.responseDescriptor.progress < 100) { callback(data.responseDescriptor); - this.progressingTimer; + this.progressingNsTimer = setTimeout(()=>{ + requeryNs(); + },5000); } else { res(data); } }) }; - this.requery(); + requeryNs(); }); return mypromise; } |