import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker' import { Injector, Component } from '@angular/core' import { first } from 'rxjs' import { ConnectableTerminalProfile } from './interfaces' import { BaseTerminalTabComponent } from './baseTerminalTab.component' import { GetRecoveryTokenOptions, RecoveryToken } from 'tabby-core' /** * A class to base your custom connectable terminal tabs on */ @Component({ template: '' }) export abstract class ConnectableTerminalTabComponent
extends BaseTerminalTabComponent
{
protected reconnectOffered = false
protected isDisconnectedByHand = false
constructor (protected injector: Injector) {
super(injector)
this.subscribeUntilDestroyed(this.hotkeys.hotkey$, hotkey => {
if (!this.hasFocus) {
return
}
switch (hotkey) {
case 'reconnect-tab':
this.reconnect()
this.notifications.notice(this.translate.instant('Reconnect'))
break
case 'disconnect-tab':
this.disconnect()
this.notifications.notice(this.translate.instant('Disconnect'))
break
}
})
}
ngOnInit (): void {
this.logger = this.log.create(`${this.profile.type}Tab`)
super.ngOnInit()
}
protected onFrontendReady (): void {
this.initializeSession()
super.onFrontendReady()
}
/**
* Initialize Connectable Session.
* Set reconnectOffered to false
*/
async initializeSession (): Promise