From 9e0b41b3294f5b74160bf60cb0ef53eb83d61047 Mon Sep 17 00:00:00 2001 From: guochuyicmri Date: Fri, 17 May 2019 10:54:54 +0800 Subject: Fix instance instantiation for CCVPN Change-Id: I59c51c33e877d9bd6566e6089228530c37d9cdc6 Issue-ID: USECASEUI-220 Signed-off-by: guochuyicmri --- .../src/app/ccvpn-creation/ccvpn-creation.component.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'usecaseui-portal/src/app/ccvpn-creation') diff --git a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts index 08307fa7..12066fca 100644 --- a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts +++ b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts @@ -93,19 +93,20 @@ export class CcvpnCreationComponent implements OnInit { }; //Screening separation sotnvpn data Object.keys(inputss).map((item) => { - if (item.search("vpn")) { + if (item.search("vpn")!=-1) { inputs["vpnresourcelist"] = inputss[item]; } - if (item.search("site")) { + if (item.search("site")!=-1) { inputs["sitereourcelist"] = inputss[item]; } }); + console.log(inputss); console.log(inputs); inputs["vpnresourcelist"].map((item, index) => { if (item["required"] != undefined) { this.templateParameters["sotnvpn"]["sdwanvpnresource_list"].push(item); } - if(item["required"] == undefined && Object.keys(item).length == 1 && Object.keys(item)[0].search("sitelan") && item[Object.keys(item)[0]] instanceof Array === true){ + if(item["required"] == undefined && Object.keys(item).length == 1 && Object.keys(item)[0].search("sitelan")!=-1 && item[Object.keys(item)[0]] instanceof Array === true){ this.templateParameters["sotnvpn"]["sdwansitelan_list"] = item[Object.keys(item)[0]] } }); @@ -115,10 +116,10 @@ export class CcvpnCreationComponent implements OnInit { if (item["required"] != undefined) { this.templateParameters["site"]["sdwansiteresource_list"].push(item); } - if(item["required"] == undefined && Object.keys(item).length == 1 && Object.keys(item)[0].search("device") && item[Object.keys(item)[0]] instanceof Array === true){ + if(item["required"] == undefined && Object.keys(item).length == 1 && Object.keys(item)[0].search("device")!=-1 && item[Object.keys(item)[0]] instanceof Array === true){ this.templateParameters["site"]["sdwandevice_list"] = item[Object.keys(item)[0]]; } - if(item["required"] == undefined && Object.keys(item).length == 1 && Object.keys(item)[0].search("sitewan") && item[Object.keys(item)[0]] instanceof Array === true){ + if(item["required"] == undefined && Object.keys(item).length == 1 && Object.keys(item)[0].search("sitewan")!=-1 && item[Object.keys(item)[0]] instanceof Array === true){ this.templateParameters["site"]["sdwansitewan_list"] = item[Object.keys(item)[0]]; } }); @@ -184,7 +185,11 @@ export class CcvpnCreationComponent implements OnInit { } } }); - + this.templateParameters.site.sdwandevice_list.map((item, index) => { + if(this.getKeys(item).indexOf("lable") == -1){ + this.templateParameters.site.sdwandevice_list.splice(index,1) + } + }); this.templateParameters.site.sdwansitewan_list.push( { ipMode: "", @@ -356,6 +361,7 @@ export class CcvpnCreationComponent implements OnInit { editSotnVpn(num){ this.sotnVpnModelShow = true; this.isEditSotnVpn = num; + console.log(this.templateParameters.sotnvpn.sdwanvpnresource_list) Object.keys(this.sotnInfo).forEach((item) => { //Clear modal box this.sotnInfo[item] = this.sotnVpnTableData[num - 1][item]; }); -- cgit 1.2.3-korg