diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2018-11-06 19:21:32 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2018-11-06 19:22:06 +0800 |
commit | e844150490b7d437da1693c52294720f59121d64 (patch) | |
tree | b17a4b2bf38a0859eaa6db955eb10d0d4cb7af11 /usecaseui-portal/src/app/services | |
parent | 3aa2334e116c1e7921ed46958ff5fed1c70fad7e (diff) |
e2eService Scale finsh
Change-Id: Ib7e5e792c6434a832bc120295888f78af555f4b6
Issue-ID: USECASEUI-163
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/services')
4 files changed, 91 insertions, 9 deletions
diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.css b/usecaseui-portal/src/app/services/services-list/services-list.component.css index 1f9d051a..15793838 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.css +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.css @@ -96,7 +96,7 @@ hr { font-size: 12px; color: green; } -.list nz-table tbody td span.stopping { +.list nz-table tbody td span.scaling { font-size: 12px; color: purple; } diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.html b/usecaseui-portal/src/app/services/services-list/services-list.component.html index 616d5b39..fa875c0f 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.html +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.html @@ -115,17 +115,17 @@ <td> <span [ngClass]="{'active':data.status=='Active','closed':data.status=='Closed','onboarding':data.status=='Onboarding', 'updating':data.status=='Updating','deleting':data.status=='Deleting','creating':data.status=='Creating', - 'stopping':data.status=='Stopping','healing':data.status=='Healing'}">{{data.status || "Active"}}</span> - <nz-progress *ngIf="data.status == 'Creating' || data.status == 'Deleting' || data.status == 'Stopping' || data.status == 'Healing' " [nzPercent]="data.rate"></nz-progress> + 'scaling':data.status=='Scaling','healing':data.status=='Healing'}">{{data.status || "Active"}}</span> + <nz-progress *ngIf="data.status == 'Creating' || data.status == 'Deleting' || data.status == 'Scaling' || data.status == 'Healing' " [nzPercent]="data.rate"></nz-progress> </td> <td> - <i [ngClass]="{'cannotclick':data.status=='Deleting'||data.status=='Creating'||data.status=='Healing'}" - *ngIf="data.serviceDomain=='E2E Service'||data.serviceDomain=='Network Service' " class="anticon anticon-setting" (click)="scaleService(data)"></i> + <i [ngClass]="{'cannotclick':data.status=='Deleting'||data.status=='Creating'||data.status=='Scaling'}" + *ngIf="data.serviceDomain=='E2E Service' " class="anticon anticon-setting" (click)="scaleService(data)"></i> <!-- <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=='Deleting'||data.status=='Creating'||data.status=='Healing'}" *ngIf="data.serviceDomain=='Network Service' " class="anticon anticon-reload" (click)="healService(data)"></i> <i *ngIf="data.serviceDomain=='SOTN'||data.serviceDomain=='CCVPN' " class="anticon anticon-ellipsis" (click)="serviceDetail(data)"></i> - <i [ngClass]="{'cannotclick':data.status=='Deleting'||data.status=='Creating'||data.status=='Healing'}" class="anticon anticon-delete" (click)="deleteModel(data)"></i> + <i [ngClass]="{'cannotclick':data.status=='Deleting'||data.status=='Creating'||data.status=='Healing'||data.status=='Scaling'}" class="anticon anticon-delete" (click)="deleteModel(data)"></i> </td> </tr> <tr class="childtr" [nzExpand]="data.expand" *ngFor="let item of data.childServiceInstances"> @@ -145,6 +145,28 @@ </ng-template> </tbody> </nz-table> + + <nz-modal [nzVisible]="scaleModelVisible" nzTitle="Scale" (nzOnCancel)="scaleCancel()" (nzOnOk)="scaleOk()"> + <h3><i class="anticon anticon-question-circle" style="color:yellow;"></i>Are you sure heal this instance?</h3> + Instance ID: <b style="color:green"> {{ thisService["service-instance-id"] || thisService["nsInstanceId"] || thisService["vnfInstanceId"]}}</b> + <div *ngFor="let item of e2e_nsData"> + <h3>{{ item.netWorkServiceName }}</h3><hr> + <span style="display:inline-block;width:50%;">Scale Type:</span> + <nz-select style="width: 165px;" [(ngModel)]="item.scaleType"> + <nz-option nzValue="SCALE_NS" nzLabel="SCALE_NS"></nz-option> + <nz-option nzValue="SCALE_VNF" nzLabel="SCALE_VNF"></nz-option> + </nz-select> + <span style="display:inline-block;width:50%;">AspectId:</span> + <input style="width: 165px;" nz-input [(ngModel)]="item.aspectId" placeholder="string"> + <span style="display:inline-block;width:50%;">Number Of Steps:</span> + <nz-input-number style="width: 165px;" [(ngModel)]="item.numberOfSteps" [nzMin]="1" [nzMax]="100" nzPrecision=0 [nzStep]="1" nzPlaceHolder="number"></nz-input-number> + <span style="display:inline-block;width:50%;">Scaling Direction:</span> + <nz-select style="width: 165px;" nzPlaceHolder="Chose" [(ngModel)]="item.scalingDirection"> + <nz-option nzValue="SCALE_IN" nzLabel="SCALE_IN"></nz-option> + <nz-option nzValue="SCALE_OUT" nzLabel="SCALE_OUT"></nz-option> + </nz-select> + </div> + </nz-modal> <nz-modal [(nzVisible)]="deleteModelVisible" nzTitle="Delete" (nzOnCancel)="deleteCancel()" (nzOnOk)="deleteOk()"> <h3><i class="anticon anticon-question-circle" style="color:yellow;"></i>Are you sure delete this instance?</h3> Instance ID: <b class="deleteModelContent"> {{ thisService["service-instance-id"] || thisService["nsInstanceId"] }}</b> diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.less b/usecaseui-portal/src/app/services/services-list/services-list.component.less index 3d9962d2..40c00231 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.less +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.less @@ -99,7 +99,7 @@ hr { font-size: 12px; color: green; } - span.stopping { + span.scaling { font-size: 12px; color: purple; } diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.ts b/usecaseui-portal/src/app/services/services-list/services-list.component.ts index 9da7cf9c..373583ea 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.ts +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.ts @@ -167,9 +167,49 @@ export class ServicesListComponent implements OnInit { } thisService = {}; //The current service of the operation - scaleService(){ - console.log("scaleService!"); + e2e_nsData:Object[]; + scaleModelVisible = false; + scaleService(service){ + this.thisService = service; + this.scaleModelVisible = true; + let paramsObj = { + customerId:this.customerSelected.id, + serviceType:this.serviceTypeSelected.name, + serviceId:service["service-instance-id"] + } + this.myhttp.getE2e_nsData(paramsObj) + .subscribe((data)=>{ + this.e2e_nsData = data; + }) + } + scaleOk(){ + this.scaleModelVisible = false; + let requestBody = { + "service": { + "serviceInstanceName": this.thisService["service-instance-name"], + "serviceType": this.serviceTypeSelected.name, + "globalSubscriberId": this.customerSelected.id, + "resources": this.e2e_nsData.map((item)=>{ + return { + "resourceInstanceId": item["netWorkServiceId"], + "scaleType": item["scaleType"], + "scaleNsData": { + "scaleNsByStepsData": { + "aspectId": item["aspectId"], + "numberOfSteps": item["numberOfSteps"], + "scalingDirection": item["scalingDirection"] + } + } + } + }) + } + } + this.scaleE2eService(this.thisService,requestBody); } + scaleCancel(){ + this.scaleModelVisible = false; + } + updataService(){ console.log("updataService!"); } @@ -511,6 +551,26 @@ export class ServicesListComponent implements OnInit { return mypromise; } + scaleE2eService(service,requestBody){ + let id = service["service-instance-id"]; + service.rate = 0; + service.status = "Scaling"; + this.myhttp.scaleE2eService(id,requestBody) + .subscribe((data)=>{ + let obj = { + serviceId:id, + operationId:data.operationId + } + let updata = (prodata)=>{ + service.rate = prodata.progress; + } + this.queryProgress(obj,updata).then(()=>{ + service.rate = 100; + service.status = "Active"; + }) + }) + } + healNsVnfService(service,requestBody){ console.log(service); service.rate = 0; |