diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-05 14:18:30 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-05 14:18:46 +0800 |
commit | fff849f2f8336212b51194f8141de27c4f38ed36 (patch) | |
tree | d366a739f7d8ce290c845b3b08839d4e2bb108a6 /usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts | |
parent | 76cafb66f1897b971736a9c9bdf2e8f0fd5a9579 (diff) |
Fix instance instantiation for NS/E2E
Change-Id: Ic95e9c067f324b3447c6fded01acfa34b4bc1551
Issue-ID: USECASEUI-252
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts | 98 |
1 files changed, 40 insertions, 58 deletions
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 3d2bfc57..b025e880 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 @@ -59,6 +59,23 @@ export class E2eCreationComponent implements OnInit { inputs2:[], vnfs:[] } + roote2e = { + "name": "e2e", + "type": "e2e", + "children": [] + }; + + rootns = { + "name": "ns", + "type": "ns", + "children": [] + }; + + imgmap = { + '1': './assets/images/create-e2e.png', + '2': './assets/images/create-ns.png', + '3': './assets/images/create-vnf.png', + }; getTemParameters(){ //Get template parameters let type = this.createParams.commonParams.templateType == "E2E Service" ? "e2e" : "ns"; this.myhttp.getTemplateParameters(type,this.createParams.template) @@ -70,6 +87,22 @@ export class E2eCreationComponent implements OnInit { this.templateParameters.nestedTemplates.forEach((item)=>{ item.inputs = item.inputs.filter((input)=>{return input.type !== "sdn_controller"}); }) + this.templateParameters.nestedTemplates.map((item,index) => { + let nsIndex={ + "name": "ns", + "type": "ns", + "children": [] + }; + nsIndex.children=item.nestedTemplates.map((item,index) => { + return { + "name": "vnf", + "type": "vnf", + } + }); + this.roote2e.children.push(nsIndex); + }); + console.log(this.templateParameters); + console.log(this.roote2e) }else if(type == "ns"){ if(typeof data["model"]=='string'){ this.nsTemplateParameters = JSON.parse(data["model"]); @@ -81,6 +114,12 @@ export class E2eCreationComponent implements OnInit { for(let key in inputs){ this.nsTemplateParameters["inputs2"].push({name:key,type:inputs[key].type,value:inputs[key].value}) } + this.rootns.children=this.nsTemplateParameters.vnfs.map((item,index) => { + return { + "name": "vnf", + "type": "vnf", + } + }); console.log(this.nsTemplateParameters); } @@ -217,64 +256,7 @@ export class E2eCreationComponent implements OnInit { this.e2eCloseCreate.emit(); } - roote2e = { - "name": "e2e", - "type": "e2e", - "children": - [ - { - "name": "ns", - "type": "ns", - "children": - [ - { - "name": "vnf", - "type": "vnf", - }, - { - "name": "vnf", - "type": "vnf", - } - ] - }, - { - "name": "ns", - "type": "ns", - "children": - [ - { - "name": "vnf", - "type": "vnf", - }, - { - "name": "vnf", - "type": "vnf", - } - ] - }] - } - - rootns = { - "name": "ns", - "type": "ns", - "children": - [ - { - "name": "vnf", - "type": "vnf", - }, - { - "name": "vnf", - "type": "vnf", - } - ] - } - - imgmap = { - '1': './assets/images/create-e2e.png', - '2': './assets/images/create-ns.png', - '3': './assets/images/create-vnf.png', - }; + drawImage(type) { if (type == "e2e") { |