diff options
5 files changed, 105 insertions, 9 deletions
diff --git a/usecaseui-portal/src/app/myhttp.service.ts b/usecaseui-portal/src/app/myhttp.service.ts index b2ab91be..45cb8955 100644 --- a/usecaseui-portal/src/app/myhttp.service.ts +++ b/usecaseui-portal/src/app/myhttp.service.ts @@ -52,6 +52,8 @@ export class MyhttpService { // vnfInfo: this.baseUrl + "/vnfInfo.json?", // progress:this.baseUrl + "/progress.json?", // nsProgress:this.baseUrl + "nsProgress.json?", + // e2eScale:this.baseUrl + "/e2eScale.json?", + // e2e_nsdata:this.baseUrl + "/e2e_nsdata.json?", // allottedResource:this.baseUrl + "/allotted-resources2.json?", // pnfDetail:this.baseUrl + "/pnfdetail-domain.json?", @@ -89,6 +91,8 @@ export class MyhttpService { vnfInfo: this.baseUrl + "/uui-lcm/VnfInfo/", progress:this.baseUrl + "/uui-lcm/services/" + "*_*" + "/operations/", nsProgress:this.baseUrl + "/uui-lcm/jobs/getNsLcmJobStatus/"+ "*_*" + "?responseId=", + e2eScale: this.baseUrl + "/services/scaleServices/", + e2e_nsdata: this.baseUrl + "/getServiceInstanceById/customerId/", allottedResource:this.baseUrl + "/uui-sotn/getAllottedResources", pnfDetail:this.baseUrl + "/uui-sotn/getPnfInfo/", @@ -219,6 +223,16 @@ export class MyhttpService { return this.http.post<any>(this.url.ns_healService + id,requestBody); } + // scale + scaleE2eService(id,requestBody){ + // return this.http.get<any>(this.url.e2eScale + id); + return this.http.post<any>(this.url.e2eScale + id,requestBody); + } + getE2e_nsData(paramsObj){ + let params = new HttpParams({fromObject:paramsObj}); + return this.http.get<any>(this.url.e2e_nsdata,{params}); + } + // Query progress interface getProgress(obj){ let url = this.url.progress.replace("*_*",obj.serviceId) + obj.operationId; 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; |