From 38b87023730268a8e9debdd0d4c3d509c511358d Mon Sep 17 00:00:00 2001 From: Clem Fern Date: Fri, 12 May 2023 20:06:40 +0200 Subject: [PATCH] ref(connectable tab) getRecoveryToken method --- tabby-serial/src/components/serialTab.component.ts | 8 -------- tabby-ssh/src/components/sshTab.component.ts | 8 -------- tabby-telnet/src/components/telnetTab.component.ts | 8 -------- .../src/api/connectableTerminalTab.component.ts | 10 ++++++++++ 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/tabby-serial/src/components/serialTab.component.ts b/tabby-serial/src/components/serialTab.component.ts index 7ae355a3..ff1e3651 100644 --- a/tabby-serial/src/components/serialTab.component.ts +++ b/tabby-serial/src/components/serialTab.component.ts @@ -90,14 +90,6 @@ export class SerialTabComponent extends ConnectableTerminalTabComponent { - return { - type: 'app:serial-tab', - profile: this.profile, - savedState: options?.includeState && this.frontend?.saveState(), - } - } - async changeBaudRate () { const rate = await this.selector.show( this.translate.instant(_('Baud rate')), diff --git a/tabby-ssh/src/components/sshTab.component.ts b/tabby-ssh/src/components/sshTab.component.ts index 21b14e89..8afa4810 100644 --- a/tabby-ssh/src/components/sshTab.component.ts +++ b/tabby-ssh/src/components/sshTab.component.ts @@ -186,14 +186,6 @@ export class SSHTabComponent extends ConnectableTerminalTabComponent } } - async getRecoveryToken (options?: GetRecoveryTokenOptions): Promise { - return { - type: 'app:ssh-tab', - profile: this.profile, - savedState: options?.includeState && this.frontend?.saveState(), - } - } - showPortForwarding (): void { const modal = this.ngbModal.open(SSHPortForwardingModalComponent).componentInstance as SSHPortForwardingModalComponent modal.session = this.sshSession! diff --git a/tabby-telnet/src/components/telnetTab.component.ts b/tabby-telnet/src/components/telnetTab.component.ts index 38bf5782..1b9a2963 100644 --- a/tabby-telnet/src/components/telnetTab.component.ts +++ b/tabby-telnet/src/components/telnetTab.component.ts @@ -73,14 +73,6 @@ export class TelnetTabComponent extends ConnectableTerminalTabComponent { - return { - type: 'app:telnet-tab', - profile: this.profile, - savedState: options?.includeState && this.frontend?.saveState(), - } - } - async canClose (): Promise { if (!this.session?.open) { return true diff --git a/tabby-terminal/src/api/connectableTerminalTab.component.ts b/tabby-terminal/src/api/connectableTerminalTab.component.ts index 36944a3d..595e27cb 100644 --- a/tabby-terminal/src/api/connectableTerminalTab.component.ts +++ b/tabby-terminal/src/api/connectableTerminalTab.component.ts @@ -6,6 +6,8 @@ import { first } from 'rxjs' import { BaseTerminalProfile } from './interfaces' import { BaseTerminalTabComponent } from './baseTerminalTab.component' +import { GetRecoveryTokenOptions } from 'tabby-core' + /** * A class to base your custom connectable terminal tabs on @@ -69,6 +71,14 @@ export abstract class ConnectableTerminalTabComponent

{ + return { + type: `app:${this.profile.type}-tab`, + profile: this.profile, + savedState: options?.includeState && this.frontend?.saveState(), + } + } + async reconnect (): Promise { this.session?.destroy() await this.initializeSession()