major structural update
This commit is contained in:
@@ -5,32 +5,20 @@ 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(){
|
||||
|
||||
|
||||
/**
|
||||
* the current config
|
||||
*/
|
||||
get config(){
|
||||
let configArray:configObject[];
|
||||
return configArray;
|
||||
}
|
||||
};
|
||||
|
||||
interface configObject {
|
||||
export interface configObject {
|
||||
host:string;
|
||||
authorized:boolean;
|
||||
sshKey:SshKey;
|
||||
|
||||
Reference in New Issue
Block a user