From b07a2113d2c40c148a8bedb0cb9fae4b8644757b Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Tue, 31 Dec 2019 23:12:08 +0100 Subject: [PATCH] ssh: added a reconnect button (fixes #761) --- terminus-ssh/src/components/sshTab.component.pug | 13 +++++++++---- terminus-ssh/src/components/sshTab.component.scss | 10 ++++++++++ terminus-ssh/src/components/sshTab.component.ts | 4 ++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/terminus-ssh/src/components/sshTab.component.pug b/terminus-ssh/src/components/sshTab.component.pug index 0bb90c35..8a01380a 100644 --- a/terminus-ssh/src/components/sshTab.component.pug +++ b/terminus-ssh/src/components/sshTab.component.pug @@ -1,10 +1,15 @@ .ssh-tab-toolbar .btn.btn-outline-secondary.reveal-button i.fas.fa-ellipsis-h - .toolbar - i.fas.fa-circle.text-success.mr-2(*ngIf='session && session.open') - i.fas.fa-circle.text-danger.mr-2(*ngIf='!session || !session.open') + .toolbar(*ngIf='session', [class.show]='!session.open') + i.fas.fa-circle.text-success.mr-2(*ngIf='session.open') + i.fas.fa-circle.text-danger.mr-2(*ngIf='!session.open') strong.mr-auto(*ngIf='session') {{session.connection.user}}@{{session.connection.host}}:{{session.connection.port}} - button.btn.btn-secondary((click)='showPortForwarding()') + + button.btn.btn-secondary((click)='showPortForwarding()', *ngIf='session.open') i.fas.fa-plug span Ports + + button.btn.btn-info((click)='reconnect()', *ngIf='!session.open') + i.fas.fa-reload + span Reconnect diff --git a/terminus-ssh/src/components/sshTab.component.scss b/terminus-ssh/src/components/sshTab.component.scss index d4fab312..6b01760b 100644 --- a/terminus-ssh/src/components/sshTab.component.scss +++ b/terminus-ssh/src/components/sshTab.component.scss @@ -55,5 +55,15 @@ pointer-events: all; } } + + &.show { + .reveal-button { + opacity: 0; + } + + .toolbar { + opacity: 1; + } + } } } diff --git a/terminus-ssh/src/components/sshTab.component.ts b/terminus-ssh/src/components/sshTab.component.ts index 67ab3c51..1dd034c5 100644 --- a/terminus-ssh/src/components/sshTab.component.ts +++ b/terminus-ssh/src/components/sshTab.component.ts @@ -75,4 +75,8 @@ export class SSHTabComponent extends BaseTerminalTabComponent { const modal = this.ngbModal.open(SSHPortForwardingModalComponent).componentInstance as SSHPortForwardingModalComponent modal.session = this.session } + + reconnect () { + this.initializeSession() + } }