From d59d5304f12591bd8d2d5c93e29b596b7b59e6c3 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Sun, 29 Sep 2019 15:27:50 +0800 Subject: bug:repair progress ccvpn/ns function Timer of service-list page Change-Id: Ibc71010cd10ef2513e4cf76c9a381b1b0a2d8caf Issue-ID: USECASEUI-306 Signed-off-by: cyuamber --- .../services-list/services-list.component.ts | 41 +++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'usecaseui-portal/src/app') 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; } -- cgit 1.2.3-korg