return (
<div key={k} style={{display:'flex'}}>
<TextInput
- onChange={props.ipProfileFn.updateProfile(j,k)}
- value={ipl['dns-server'][k]}
+ onChange={props.dnsFn.updateDNS(j,k)}
+ value={ipl['dns-server'][k].address}
/>
<span onClick={props.dnsFn.removeDNS(j,k)} className="removeInput">
<img src={imgRemove} />Remove</span>
let self = this;
return function(e) {
if(self.ipProfiles[i]['ip-profile-params']['dns-server']) {
- self.ipProfiles[i]['ip-profile-params']['dns-server'].unshift('')
+ self.ipProfiles[i]['ip-profile-params']['dns-server'].unshift({})
} else {
- self.ipProfiles[i]['ip-profile-params']['dns-server'] = [''];
+ self.ipProfiles[i]['ip-profile-params']['dns-server'] = [{}];
}
self.setState({ipProfiles:self.ipProfiles});
}
self.setState({ipProfiles:self.ipProfiles});
}
+ },
+ updateDNS: (i, k) => {
+ let self = this;
+ return function(e) {
+ let value = e.target.value;
+ self.ipProfiles[i]['ip-profile-params']['dns-server'][k].address = value;
+ self.setState({ipProfiles:self.ipProfiles});
+ }
}
}
}