From f4db02a7196dab797cac3b2a43c12a462818e2f4 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Wed, 4 Sep 2019 15:23:44 +0800 Subject: feat: services-list page code optimization Change-Id: I69ce94f5add562896bb760e6e4974621c3a3e9be Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- .../services-list/services-list.component.html | 4 -- .../services-list/services-list.component.ts | 60 +--------------------- 2 files changed, 2 insertions(+), 62 deletions(-) (limited to 'usecaseui-portal') diff --git a/usecaseui-portal/src/app/views/services/services-list/services-list.component.html b/usecaseui-portal/src/app/views/services/services-list/services-list.component.html index 206ecd8f..a995b485 100644 --- a/usecaseui-portal/src/app/views/services/services-list/services-list.component.html +++ b/usecaseui-portal/src/app/views/services/services-list/services-list.component.html @@ -75,7 +75,6 @@ {{"i18nTextDefine_UseCase" | translate}} : - @@ -193,9 +192,6 @@ {{"i18nTextDefine_Update" | translate}} - - 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 d4f5c2b5..72cacc7e 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 @@ -1114,8 +1114,8 @@ export class ServicesListComponent implements OnInit { } deleteService(service, templateDeleteSuccessFaild) { - let allprogress = {}; // - let querypros = []; // + let allprogress = {}; + let querypros = []; service.rate = 0; service.status = "In Progress"; service.tips = ""; @@ -1280,19 +1280,6 @@ export class ServicesListComponent implements OnInit { queryProgress(obj, callback) { let mypromise = new Promise((res, rej) => { - // let data = { - // operationStatus:{ - // "operationId": "XXXXXX", - // "operation": "create|delete|update|scale", - // "result": "finished|error|processing", - // "reason": "", - // "userId": "", - // "operationContent": "Be creating pop.", - // "progress": 0, - // "operateAt": "", - // "finishedAt": "" - // } - // } let errorNums = 180; let requery = () => { this.myhttp.getProgress(obj) @@ -1302,7 +1289,6 @@ export class ServicesListComponent implements OnInit { return false; } if (data.operationStatus == null || data.operationStatus.progress == undefined) { - // console.log(data); errorNums--; if (errorNums == 0) { callback({ progress: 255, status: "time over" }); @@ -1326,17 +1312,6 @@ export class ServicesListComponent implements OnInit { res(data.operationStatus); } }) - // setTimeout(()=>{ - // console.log(data.operationStatus.progress) - // data.operationStatus.progress++; - // if(data.operationStatus.progress<100){ - // callback(data.operationStatus); - // requery() - // }else{ - // callback(data.operationStatus); - // res(data.operationStatus) - // } - // },100) } requery(); }) @@ -1345,25 +1320,6 @@ export class ServicesListComponent implements OnInit { queryNsProgress(jobid, id, callback, operationType) { let mypromise = new Promise((res, rej) => { - // let data = { - // "jobId": "string", - // "responseDescriptor": { - // "status": "string", - // "progress": 0, - // "statusDescription": "string", - // "errorCode": "string", - // "responseId": "string", - // "responseHistoryList": [ - // { - // "status": "string", - // "progress": "string", - // "statusDescription": "string", - // "errorCode": "string", - // "responseId": "string" - // } - // ] - // } - // } let errorNums = 180; let requery = () => { this.myhttp.getNsProgress(jobid, id, operationType) @@ -1373,7 +1329,6 @@ export class ServicesListComponent implements OnInit { return false; } if (data.responseDescriptor == null || data.responseDescriptor.progress == undefined) { - // console.log(data); errorNums--; if (errorNums == 0) { callback({ progress: 255, status: "time over" }); @@ -1397,17 +1352,6 @@ export class ServicesListComponent implements OnInit { res(data); } }) - // setTimeout(()=>{ - // console.log(data.responseDescriptor.progress) - // data.responseDescriptor.progress++; - // if(data.responseDescriptor.progress<100){ - // callback(data.responseDescriptor); - // requery() - // }else{ - // callback(data); - // res(data) - // } - // },100) }; requery(); }); -- cgit 1.2.3-korg