diff options
author | Tao Shen <shentao@chinamobile.com> | 2018-11-14 09:28:07 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-14 09:28:07 +0000 |
commit | a79f49321ee56b66011f8daba0ecaee4d6b63670 (patch) | |
tree | 448d6d06822c9e97bbd037bbb2f617a8ce8c66b2 /usecaseui-portal/src/app | |
parent | 53266fd0f2709e2f1a3d87b073d317e0579fa1f0 (diff) | |
parent | 946f2383255ef8c05473251213209c301bb1c9b5 (diff) |
Merge "fix ns service instantiation for vf-c"
Diffstat (limited to 'usecaseui-portal/src/app')
4 files changed, 24 insertions, 26 deletions
diff --git a/usecaseui-portal/src/app/app.component.html b/usecaseui-portal/src/app/app.component.html index 8e189e73..df0890e6 100644 --- a/usecaseui-portal/src/app/app.component.html +++ b/usecaseui-portal/src/app/app.component.html @@ -59,16 +59,11 @@ </a> </li> </ul> - <button (click)="changeLanguage('zh')" >{{"zh" | translate}}</button> - <button (click)="changeLanguage('en')" >{{"en" | translate}}</button> - <select name="Language" id="" [(ngModel)]="selectLanguage" (change)="changeLanguage1()"> - <option *ngFor="let item of Language" value="{{item}}">{{item | translate}}</option> - </select> <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomRight'"> <button nz-button nz-dropdown><span>{{selectLanguage | translate}}</span> <i class="anticon anticon-down"></i></button> <ul nz-menu> - <li nz-menu-item (click)="changeLanguage2(item)" *ngFor="let item of Language"> + <li nz-menu-item (click)="changeLanguage(item)" *ngFor="let item of Language"> <a>{{item | translate}}</a> </li> </ul> diff --git a/usecaseui-portal/src/app/app.component.ts b/usecaseui-portal/src/app/app.component.ts index be13c1a1..42907270 100644 --- a/usecaseui-portal/src/app/app.component.ts +++ b/usecaseui-portal/src/app/app.component.ts @@ -13,22 +13,13 @@ export class AppComponent { translate.setDefaultLang('en'); // translate.use('en'); } - changeLanguage(Language): void { - switch(Language){ - case 'en': - this.translate.use('en'); - break; - case 'zh': - this.translate.use('zh'); - } - } + // 多语言 Language:String[] = ["zh","en"]; selectLanguage = "en"; - changeLanguage1(){ - this.translate.use(this.selectLanguage); - } - changeLanguage2(item){ + + changeLanguage(item){ + this.selectLanguage = item; this.translate.use(item); } } diff --git a/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts b/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts index 02d6229b..213df2b8 100644 --- a/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts +++ b/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts @@ -61,15 +61,19 @@ export class E2eCreationComponent implements OnInit { let type = this.createParams.commonParams.templateType == "E2E Service" ? "e2e" : "ns"; this.myhttp.getTemplateParameters(type,this.createParams.template) .subscribe((data)=>{ - console.log(this.createParams); - console.log(data); + // console.log(this.createParams); + // console.log(data); if(type == "e2e"){ this.templateParameters = data; this.templateParameters.nestedTemplates.forEach((item)=>{ item.inputs = item.inputs.filter((input)=>{return input.type !== "sdn_controller"}); }) }else if(type == "ns"){ - this.nsTemplateParameters = data; + if(typeof data["model"]=='string'){ + this.nsTemplateParameters = JSON.parse(data["model"]); + }else{ + this.nsTemplateParameters = data; + } this.nsTemplateParameters["inputs2"] = []; let inputs = this.nsTemplateParameters.inputs; for(let key in inputs){ @@ -139,8 +143,8 @@ export class E2eCreationComponent implements OnInit { this.service.globalSubscriberId = this.createParams.commonParams.customer.id; this.service.serviceType = this.createParams.commonParams.serviceType.name; - this.templateParameters.inputs.forEach((item)=>{ - this.service.parameters.requestInputs[item.name] = item.value == undefined ? item.defaultValue : item.value; + this.templateParameters.inputs.forEach((ipnut)=>{ + this.service.parameters.requestInputs[ipnut.name] = ipnut.value == undefined ? ipnut.defaultValue : ipnut.value; }) this.templateParameters.nestedTemplates.forEach((item)=>{ @@ -164,6 +168,8 @@ export class E2eCreationComponent implements OnInit { } } nsService.parameters.locationConstraints.push(location); + }else{ + nsService.parameters.requestInputs[input.name] = input.value == undefined ? input.defaultValue : input.value; } }) this.service.parameters.resources.push(nsService); 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 7fac33de..003e897f 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 @@ -95,11 +95,17 @@ export class ServicesListComponent implements OnInit { getAlltemplates(){ // this.myhttp.getAllServiceTemplates(this.templateTypeSelected) .subscribe((data)=>{ - console.log(data) + // console.log(data) this.templates = data; if(this.templateTypeSelected=="Network Service"){ - this.templates = data.map((item)=>{return {name:item.packageInfo.csarName,id:item.csarId,packageInfo:item.packageInfo}}); + this.templates = data.filter((d)=>{ + return typeof d.packageInfo.csarName== "string"; + }).map((item)=>{ + let cName = item.packageInfo.csarName.split("/").reverse()[0]; + return {name:cName,id:item.csarId,packageInfo:item.packageInfo} + }); } + console.log(this.templates); this.template1 = this.templates[0]; this.template2 = this.templates[1]; this.template3 = this.templates[2]; |