smartssh/ts/smartssh.classes.sshconfig.ts
2016-06-25 02:10:53 +02:00

39 lines
974 B
TypeScript

import "typings-global";
import * as plugins from "./smartssh.plugins";
import * as helpers from "./smartssh.classes.helpers";
import {SshKey} from "./smartssh.classes.sshkey"
export class SshConfig {
sshKeyArray:SshKey[];
config:configObject[];
constructor(sshKeyArrayArg:SshKey[]){
this.sshKeyArray = sshKeyArrayArg;
this.config = [];
}
makeConfig(){
// clear old config in place
let configLength = this.config.length;
for(let i = 0; i < configLength; i++){
this.config.pop();
}
for(let key in this.sshKeyArray){
let localSshKey = this.sshKeyArray[key];
this.config.push({
host: localSshKey.host,
authorized: localSshKey.authorized,
sshKey: localSshKey
})
}
}
storeConfig(){
}
};
interface configObject {
host:string;
authorized:boolean;
sshKey:SshKey;
};