feat: services-list page code optimization 85/94885/1
authorcyuamber <xuranyjy@chinamobile.com>
Wed, 4 Sep 2019 07:23:44 +0000 (15:23 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Wed, 4 Sep 2019 07:23:56 +0000 (15:23 +0800)
Change-Id: I69ce94f5add562896bb760e6e4974621c3a3e9be
Issue-ID: USECASEUI-307
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/views/services/services-list/services-list.component.html
usecaseui-portal/src/app/views/services/services-list/services-list.component.ts

index 206ecd8..a995b48 100644 (file)
@@ -75,7 +75,6 @@
             <span style="display:inline-block;"> {{"i18nTextDefine_UseCase" | translate}} : </span>
             <nz-select style="width: 176px;float: right;" [(ngModel)]="templateTypeSelected" nzAllowClear
                 (ngModelChange)="choseTemplateType()">
-                <!-- <nz-option *ngFor="let item of templateType" [nzValue]="item" [nzLabel]="item"></nz-option> -->
                 <nz-option nzValue="SOTN" nzLabel="SOTN"></nz-option>
                 <nz-option nzValue="CCVPN" nzLabel="CCVPN"></nz-option>
                 <nz-option nzValue="E2E Service" nzLabel="E2E Service"></nz-option>
                                     <span> {{"i18nTextDefine_Update" | translate}} </span>
                                 </li>
                             </ul>
-                            <!-- <i *ngIf="data.serviceDomain=='E2E Service'||data.serviceDomain=='Network Service' " class="anticon anticon-cloud-upload-o" (click)="updataService(data)"></i> -->
-                            <!-- <i [ngClass]="{'cannotclick':data.status == 'processing'||data.status=='Deleting'||data.status=='Creating'||data.status=='Healing'}"
-                          *ngIf="data.serviceDomain=='Network Service' " class="anticon anticon-reload" (click)="healService(data)"></i> -->
                         </td>
                     </tr>
                     <tr class="childtr" [nzExpand]="data.expand" *ngFor="let item of data.childServiceInstances">
index d4f5c2b..72cacc7 100644 (file)
@@ -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();
         });