diff --git a/src/common/interfaces/antares.ts b/src/common/interfaces/antares.ts index ba040b27..6855cbf7 100644 --- a/src/common/interfaces/antares.ts +++ b/src/common/interfaces/antares.ts @@ -65,6 +65,7 @@ export interface ConnectionParams { sshKey?: string; sshPort?: number; sshPassphrase?: string; + sshKeepAliveInterval?: number; } export interface TypeInformations { diff --git a/src/main/ipc-handlers/connection.ts b/src/main/ipc-handlers/connection.ts index ccef6362..ea8a0630 100644 --- a/src/main/ipc-handlers/connection.ts +++ b/src/main/ipc-handlers/connection.ts @@ -24,6 +24,7 @@ export default (connections: {[key: string]: antares.Client}) => { port: number; privateKey: string; passphrase: string; + keepaliveInterval: number; } }; @@ -50,7 +51,8 @@ export default (connections: {[key: string]: antares.Client}) => { password: conn.sshPass, port: conn.sshPort ? conn.sshPort : 22, privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null, - passphrase: conn.sshPassphrase + passphrase: conn.sshPassphrase, + keepaliveInterval: conn.sshKeepAliveInterval ?? conn.sshKeepAliveInterval*1000 }; } @@ -99,6 +101,7 @@ export default (connections: {[key: string]: antares.Client}) => { port: number; privateKey: string; passphrase: string; + keepaliveInterval: number; } }; @@ -128,7 +131,8 @@ export default (connections: {[key: string]: antares.Client}) => { password: conn.sshPass, port: conn.sshPort ? conn.sshPort : 22, privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null, - passphrase: conn.sshPassphrase + passphrase: conn.sshPassphrase, + keepaliveInterval: conn.sshKeepAliveInterval ?? conn.sshKeepAliveInterval*1000 }; } diff --git a/src/main/libs/clients/MySQLClient.ts b/src/main/libs/clients/MySQLClient.ts index 98c3f207..03a690fb 100644 --- a/src/main/libs/clients/MySQLClient.ts +++ b/src/main/libs/clients/MySQLClient.ts @@ -156,7 +156,6 @@ export class MySQLClient extends AntaresCore { this._ssh = new SSH2Promise({ ...this._params.ssh, - keepaliveInterval: 30*60*1000, debug: process.env.NODE_ENV !== 'production' ? (s) => console.log(s) : null }); diff --git a/src/main/libs/clients/PostgreSQLClient.ts b/src/main/libs/clients/PostgreSQLClient.ts index 3f375329..3ca56863 100644 --- a/src/main/libs/clients/PostgreSQLClient.ts +++ b/src/main/libs/clients/PostgreSQLClient.ts @@ -168,7 +168,6 @@ export class PostgreSQLClient extends AntaresCore { try { this._ssh = new SSH2Promise({ ...this._params.ssh, - keepaliveInterval: 30*60*1000, debug: process.env.NODE_ENV !== 'production' ? (s) => console.log(s) : null }); diff --git a/src/renderer/components/WorkspaceAddConnectionPanel.vue b/src/renderer/components/WorkspaceAddConnectionPanel.vue index 8008d6c5..129fa244 100644 --- a/src/renderer/components/WorkspaceAddConnectionPanel.vue +++ b/src/renderer/components/WorkspaceAddConnectionPanel.vue @@ -33,10 +33,10 @@