diff options
author | 2019-05-17 10:54:54 +0800 | |
---|---|---|
committer | 2019-05-17 10:54:58 +0800 | |
commit | 9e0b41b3294f5b74160bf60cb0ef53eb83d61047 (patch) | |
tree | 928a8352197fab9696dbe72d2a7d93830fa57eff /usecaseui-portal | |
parent | 328b97e2e0be28a4cb70f3d9435755c2b9301ca0 (diff) |
Fix instance instantiation for CCVPN
Change-Id: I59c51c33e877d9bd6566e6089228530c37d9cdc6
Issue-ID: USECASEUI-220
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal')
-rw-r--r-- | usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts | 18 |
1 files changed, 12 insertions, 6 deletions
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]; }); |