From 9b7c41cc4a49bc1980ed48d6a29fc28f1b291417 Mon Sep 17 00:00:00 2001 From: guochuyicmri Date: Wed, 3 Apr 2019 18:11:44 +0800 Subject: Fix instance instantiation for CCVPN Change-Id: I6c902286db6730192c3127754b5f452258c12ee2 Issue-ID: USECASEUI-220 Signed-off-by: guochuyicmri --- .../ccvpn-creation/ccvpn-creation.component.html | 42 +++++++++--------- .../app/ccvpn-creation/ccvpn-creation.component.ts | 50 ++++++++++------------ 2 files changed, 43 insertions(+), 49 deletions(-) (limited to 'usecaseui-portal/src/app/ccvpn-creation') diff --git a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html index f64e1237..2f0469c2 100644 --- a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html +++ b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.html @@ -284,17 +284,17 @@ {{i+1}} - {{item.sitewanport_name}} - + {{item.sitewanport_name}} + - {{item.sitewanport_description}} - + {{item.sitewanport_description}} + - {{item.sitewanport_portType}} - + {{item.sitewanport_portType}} + @@ -304,32 +304,32 @@ - {{item.sitewanport_portNumber}} - + {{item.sitewanport_portNumber}} + - {{item.sitewanport_ipAddress}} - + {{item.sitewanport_ipAddress}} + - {{item.sitewanport_providerIpAddress}} - + {{item.sitewanport_providerIpAddress}} + - {{item.sitewanport_transportNetworkName}} - + {{item.sitewanport_transportNetworkName}} + - {{item.sitewanport_inputBandwidth}} - + {{item.sitewanport_inputBandwidth}} + - {{item.sitewanport_outputBandwidth}} - + {{item.sitewanport_outputBandwidth}} + - - + + 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 40ea977d..8ea51321 100644 --- a/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts +++ b/usecaseui-portal/src/app/ccvpn-creation/ccvpn-creation.component.ts @@ -75,8 +75,12 @@ export class CcvpnCreationComponent implements OnInit { }) this.siteWanNames = Object.values(wanportnames); this.siteWanNames.forEach((item)=>{ - this.siteWanData.push(this.siteWanParams); //Add a table according to the wanport group + this.siteWanData.push(Object.assign({},this.siteWanParams)); //Add a table according to the wanport group }) + this.siteWanData.forEach((item,index) => { + item.indexs=index; + }); + console.log(this.siteWanData) // console.log(this.sotnNames) // console.log(this.siteNames) // console.log(this.siteBaseNames) @@ -163,39 +167,29 @@ export class CcvpnCreationComponent implements OnInit { sitewanport_providerIpAddress:null, sitewanport_transportNetworkName:null, sitewanport_inputBandwidth:null, - sitewanport_outputBandwidth:null + sitewanport_outputBandwidth: null, + tabInputShow:false, + indexs:null, }; siteWanNames = [] //Real name - wanPortModal = false; //Modal box display hidden wanPortEditNum = 0;//Which line to edit - editWanPort(num) { - // if(){ + editWanPort(num,item,siteWanData) { console.log(this) - console.log(num) - if (!this.wanPortModal) { - console.log(11111) - console.log(this.wanPortModal) - this.wanPortModal = true; - this.wanPortEditNum = num; - this.siteWanParams = Object.assign({}, this.siteWanData[num - 1]); - } else { - console.log(22222) - let inputsData = Object.assign({}, this.siteWanParams); //Create a new object, disconnect the original reference, because you want to empty the modal box later - inputsData.sitewanport_deviceName = this.siteCpeData.device_name; - this.siteWanData[this.wanPortEditNum - 1] = inputsData; - this.siteWanData = [...this.siteWanData]; //Table refresh - Object.keys(this.siteWanParams).forEach((item) => { //Clear modal box - this.siteWanParams[item] = null; - }) - this.wanPortModal = false; - console.log(this.siteWanData) - } - // } + console.log(siteWanData) + console.log(item) + siteWanData.map((its) => { + if(its.indexs==item.indexs){ + if (its.tabInputShow==false) { + this.wanPortEditNum = num; + item.tabInputShow=true; + } else { + item.tabInputShow=false; + console.log(this.siteWanData) + } + } + }) } - wanPortModal_Cancel(){ - this.wanPortModal = false; - } // Get the site address, manual file -- cgit 1.2.3-korg