+ },
+ updateSSHkeyRef: function(i, j, remove){
+ return function(e) {
+ let usersList = _.cloneDeep(self.usersList)
+ let keys = usersList[i]['ssh-authorized-key'];
+ if(!remove) {
+ let keyRef = JSON.parse(e.target.value).name;
+ if(!isNaN(j)) {
+ keys.splice(j, 1);
+ }
+ keys.push(keyRef);
+ } else {
+ keys.splice(j, 1);
+ }
+ usersList[i]['ssh-authorized-key'] = keys;
+ self.setState({
+ usersList: usersList
+ })
+ }