diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-17 13:46:55 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-17 16:21:57 +0800 |
commit | 2fa013e2aab85f943e75356a4b6743f8efa6e36d (patch) | |
tree | 2fd4a51a2e81a3a2e02fc4f17bf23f753f8e601f /usecaseui-portal/src/app/services/services-list | |
parent | b04c4a38e808215a975d27536ce9a243981bd5e5 (diff) |
Service instance lifecycle management
Change-Id: Ic4d63972757adf2a21e59a39990d8c8b504fb812
Issue-ID: USECASEUI-218
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/services/services-list')
-rw-r--r-- | usecaseui-portal/src/app/services/services-list/services-list.component.html | 6 | ||||
-rw-r--r-- | usecaseui-portal/src/app/services/services-list/services-list.component.ts | 89 |
2 files changed, 52 insertions, 43 deletions
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 c266c41d..3185869d 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 @@ -50,7 +50,7 @@ </div> <div class="select-list"> <span style="display:inline-block;"> {{"i18nTextDefine_ServiceType" | translate}} : </span> - <nz-select style="width: 176px;float: right;" [(ngModel)]="serviceTypeSelectedName" nzAllowClear> + <nz-select style="width: 176px;float: right;" [(ngModel)]="serviceTypeSelectedName" nzAllowClear (ngModelChange)="serviceTypeChange()"> <nz-option *ngFor="let item of serviceTypeList2" [nzValue]="item.name" [nzLabel]="item.name" ></nz-option> </nz-select> </div> @@ -654,6 +654,6 @@ <!--</div>--> </nz-layout> <div class="loading" *ngIf="loadingAnimateShow"> - <img src="../../../assets/images/loading-animate2.gif" alt="loading"> - <p>Please watingˇˇ</p> + <img src="./assets/images/loading-animate2.gif" alt="loading"> + <p>Please wating……</p> </div> 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 986cbf50..fb110626 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 @@ -42,8 +42,8 @@ export class ServicesListComponent implements OnInit { customerSelected2 = {name: null, id: null}; serviceTypeList = []; serviceTypeList2 = []; - serviceTypeSelected = {name:null}; - serviceTypeSelected2 = {name: null}; + serviceTypeSelected = {name:''}; + serviceTypeSelected2 = {name: ''}; serviceTypeSelectedName = ""; templateTypeSelected ="CCVPN"; orchestratorSelected = {name:null,id:null}; @@ -162,17 +162,19 @@ export class ServicesListComponent implements OnInit { console.log("serviceTypeList.length == 0", this.serviceTypeList2); return false; } - this.serviceTypeSelected2 = this.serviceTypeSelected; - this.serviceTypeSelectedName = this.serviceTypeSelected2.name; - console.log(this.customerSelected2); - console.log(this.serviceTypeSelected2); this.getAlltemplates(); }) } + serviceTypeChange(): void { + this.serviceTypeSelected2.name = this.serviceTypeSelectedName + console.log(this.serviceTypeSelectedName) + } createModal(): void { this.isVisible = true; this.getallOrchestrators(); this.customerSelected2 = this.customerSelected; + this.serviceTypeSelectedName = this.serviceTypeSelected.name; + this.serviceTypeSelected2 = Object.assign({},this.serviceTypeSelected); this.getServiceType(this.customerSelected2); } // @@ -250,7 +252,7 @@ export class ServicesListComponent implements OnInit { if (data.status == "FAILED") { this.temParametersTips = true; this.isVisible = true; - console.log("Template parsing failed"); + console.log("Template parsing Failed"); }else { this.isVisible = false; this.temParametersTips = false; @@ -736,7 +738,7 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { 'service-instance-name':obj.service.name, serviceDomain:this.templateTypeSelected, childServiceInstances:[], - status:"Creating", + status:"In Progress", statusClass: 1001, rate:0, tips:"" @@ -746,7 +748,9 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.createNotification(templateCreatestarting); let updata = (prodata)=>{ newData.rate = prodata.progress; - newData.tips = newData["status"]+newData.rate+"%"; + newData.tips = this.listSortMasters["operationTypes"].find((its) => { + return its["sortCode"] == newData["statusClass"] && its["language"] == this.language + })["sortValue"] + newData.rate + "%"; if(newData["rate"] > 100){ newData["status"]= prodata.status; newData.tips = this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==newData["statusClass"] && its["language"]==this.language})["sortValue"]+'\xa0\xa0\xa0'+newData["status"]; @@ -795,18 +799,18 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { 'service-instance-name':obj.step1.nsName, serviceDomain:this.templateTypeSelected, childServiceInstances:[], - status:"Creating", - statusClass: 1001, + status:"In Progress", + statusClass: 1001, rate:0, tips:"" } - this.thisCreateService = newData; + this.thisCreateService = newData; this.tableData = [newData,...this.tableData]; - this.createNotification(templateCreatestarting); + this.createNotification(templateCreatestarting); if(data.status == "FAILED"){ - this.createSuccessNotification(templateCreateSuccessFaild); - console.log("create ns service failed :" + JSON.stringify(data)); - newData.status = "failed"; + console.log("create ns service Failed :" + JSON.stringify(data)); + newData.status = "Failed"; + this.createSuccessNotification(templateCreateSuccessFaild); return false; } let createParams = "?ns_instance_id=" + data.nsInstanceId + @@ -816,9 +820,12 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { "&parentServiceInstanceId="; // step2 this.createNsService(createParams,obj.step2).then((jobid)=>{ - if(jobid == "failed"){ - this.createSuccessNotification(templateCreateSuccessFaild); - newData.status = "failed"; + if(jobid == "Failed"){ + newData.status = "Failed"; + console.log(jobid,"ns two jobid") + this.thisCreateService = newData; + console.log(this.thisCreateService) + this.createSuccessNotification(templateCreateSuccessFaild); newData.tips = this.listSortMasters["operationTypes"].find((its) => { return its["sortCode"] == newData["statusClass"] && its["language"] == this.language })["sortValue"] + '\xa0\xa0\xa0' + this.listSortMasters["operationResults"].find((its) => { @@ -829,7 +836,9 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { let operationType="1001"; let updata = (prodata)=>{ newData.rate = prodata.progress; - newData.tips = newData["status"]+newData.rate+"%"; + newData.tips = this.listSortMasters["operationTypes"].find((its) => { + return its["sortCode"] == newData["statusClass"] && its["language"] == this.language + })["sortValue"] + newData.rate + "%"; if(newData["rate"] > 100){ newData["status"]=prodata.status; newData.tips = this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==newData["statusClass"] && its["language"]==this.language})["sortValue"]+'\xa0\xa0\xa0'+newData["status"]; @@ -864,8 +873,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.createInstance(requestBody,createParams) .subscribe((data)=>{ if(data.status == "FAILED"){ - this.createSuccessNotification(templateCreateSuccessFaild); - console.log("create e2e service failed :" + JSON.stringify(data)); + res("Failed"); + console.log("create e2e service Failed :" + JSON.stringify(data)); return false; } res(data.service); @@ -878,8 +887,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.nsCreateInstance2(id,obj) .subscribe((data)=>{ if(data.status == "FAILED"){ - console.log("instantiate ns service failed :" + JSON.stringify(data)); - res("failed"); + console.log("instantiate ns service Failed :" + JSON.stringify(data)); + res("Failed"); return false; } res(data.jobId); @@ -897,8 +906,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.scaleE2eService(id,requestBody) .subscribe((data)=>{ if(data.status == "FAILED"){ - console.log("scale E2e service failed :" + JSON.stringify(data)); - service.status = "failed"; + console.log("scale E2e service Failed :" + JSON.stringify(data)); + service.status = "Failed"; service.tips = this.listSortMasters["operationTypes"].find((its) => { return its["sortCode"] == service.statusClass && its["language"] == this.language })["sortValue"] + '\xa0\xa0\xa0' + this.listSortMasters["operationResults"].find((its) => { @@ -947,8 +956,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.healNsService(id,requestBody) .subscribe((data)=>{ if(data.status == "FAILED"){ - console.log("heal nsvnf service failed :" + JSON.stringify(data)); - service.status = "failed"; + console.log("heal nsvnf service Failed :" + JSON.stringify(data)); + service.status = "Failed"; service.tips = this.listSortMasters["operationTypes"].find((its) => { return its["sortCode"] == service.statusClass && its["language"] == this.language })["sortValue"] + '\xa0\xa0\xa0' + this.listSortMasters["operationResults"].find((its) => { @@ -1004,8 +1013,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.deleteInstance(params) .subscribe((data)=>{ if(data.status == "FAILED"){ - console.log("delete service failed :" + JSON.stringify(data)); - service.status = "failed"; + console.log("delete service Failed :" + JSON.stringify(data)); + service.status = "Failed"; service.tips = this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==service.statusClass && its["language"]==this.language})["sortValue"]+'\xa0\xa0\xa0'+ this.listSortMasters["operationResults"].find((its) => { return its["sortCode"] == 2002 && its["language"] == this.language })["sortValue"]; @@ -1060,8 +1069,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { gracefulTerminationTimeout : this.gracefulTerminationTimeout } this.stopNsService(id,requestBody).then((jobid)=>{ - if(jobid == "failed"){ - service.status = "failed"; + if(jobid == "Failed"){ + service.status = "Failed"; service.tips = this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==service.statusClass && its["language"]==this.language})["sortValue"] + this.listSortMasters["operationResults"].find((its) => { return its["sortCode"] == 2002 && its["language"] == this.language })["sortValue"]; @@ -1087,8 +1096,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { })["sortValue"]; this.deleteSuccessNotification(templateDeleteSuccessFaild); if(data.status == "FAILED"){ - console.log("delete ns service failed :" + JSON.stringify(data)); - service.status = "failed"; + console.log("delete ns service Failed :" + JSON.stringify(data)); + service.status = "Failed"; service.tips = this.listSortMasters["operationTypes"].find((its)=>{ return its["sortCode"]==service.statusClass && its["language"]==this.language})["sortValue"] + this.listSortMasters["operationResults"].find((its) => { return its["sortCode"] == 2002 && its["language"] == this.language })["sortValue"]; @@ -1115,8 +1124,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.stopNsService(id,obj) .subscribe((data)=>{ if(data.status == "FAILED"){ - console.log("stop ns service failed :" + JSON.stringify(data)); - res("failed"); + console.log("stop ns service Failed :" + JSON.stringify(data)); + res("Failed"); return false; } res(data.jobId); @@ -1144,7 +1153,7 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.getProgress(obj) .subscribe((data)=>{ if(data.status == "FAILED"){ - callback({progress:255,status:"failed"}); + callback({progress:255,status:"Failed"}); return false; } if(data.operationStatus == null || data.operationStatus.progress==undefined){ @@ -1214,7 +1223,7 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { this.myhttp.getNsProgress(jobid,id,operationType) .subscribe((data)=>{ if(data.status == "FAILED"){ - callback({progress:255,status:"failed"}); + callback({progress:255,status:"Failed"}); return false; } if(data.responseDescriptor == null || data.responseDescriptor.progress==undefined){ @@ -1229,8 +1238,8 @@ e2eCloseCreate(obj,templateCreatestarting,templateCreateSuccessFaild) { },10000) return false; } - if(data.responseDescriptor.progress > 100){ - callback({progress:255,status:"time over"}); + if(data.responseDescriptor.progress > 100 && data.responseDescriptor.status == "error"){ + callback({progress:255,status:data.responseDescriptor.statusDescription}); return false; } if(data.responseDescriptor.progress < 100){ |