From 4b3cbc5639637fa4536a280de5dc4bcaf3b1eccd Mon Sep 17 00:00:00 2001 From: Domain Date: Wed, 12 Sep 2018 10:39:18 +0800 Subject: [PATCH] Add keep alive in advanced setting --- terminus-ssh/src/api.ts | 3 ++ .../editConnectionModal.component.pug | 28 +++++++++++++++++++ terminus-ssh/src/services/ssh.service.ts | 3 ++ 3 files changed, 34 insertions(+) diff --git a/terminus-ssh/src/api.ts b/terminus-ssh/src/api.ts index 38565aec..df8e53be 100644 --- a/terminus-ssh/src/api.ts +++ b/terminus-ssh/src/api.ts @@ -14,6 +14,9 @@ export interface SSHConnection { privateKey?: string group?: string scripts?: LoginScript[] + keepaliveInterval?: number + keepaliveCountMax?: number + readyTimeout?: number } export class SSHSession extends BaseSession { diff --git a/terminus-ssh/src/components/editConnectionModal.component.pug b/terminus-ssh/src/components/editConnectionModal.component.pug index ba99b909..7b300f81 100644 --- a/terminus-ssh/src/components/editConnectionModal.component.pug +++ b/terminus-ssh/src/components/editConnectionModal.component.pug @@ -58,6 +58,34 @@ button.btn.btn-secondary((click)='selectPrivateKey()') i.fa.fa-folder-open + ngb-tab(id='advanced') + ng-template(ngbTabTitle) + | Advanced Setting + ng-template(ngbTabContent) + .form-group + label Keep Alive Interval (Milliseconds) + input.form-control( + type='number', + placeholder='0', + [(ngModel)]='connection.keepaliveInterval', + ) + + .form-group + label Max Keep Alive Count + input.form-control( + type='number', + placeholder='3', + [(ngModel)]='connection.keepaliveCountMax', + ) + + .form-group + label Ready Timeout (Milliseconds) + input.form-control( + type='number', + placeholder='20000', + [(ngModel)]='connection.readyTimeout', + ) + ngb-tab(id='scripts') ng-template(ngbTabTitle) | Login Scripts diff --git a/terminus-ssh/src/services/ssh.service.ts b/terminus-ssh/src/services/ssh.service.ts index 657b63e4..8a49a924 100644 --- a/terminus-ssh/src/services/ssh.service.ts +++ b/terminus-ssh/src/services/ssh.service.ts @@ -110,6 +110,9 @@ export class SSHService { tryKeyboard: true, agent, agentForward: !!agent, + keepaliveInterval: connection.keepaliveInterval, + keepaliveCountMax: connection.keepaliveCountMax, + readyTimeout: connection.readyTimeout, }) let keychainPasswordUsed = false