mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-10 02:21:50 +00:00
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Profile } from 'tabby-core'
|
||||
import { LoginScriptsOptions } from 'tabby-terminal'
|
||||
import { BaseTerminalProfile, LoginScriptsOptions } from 'tabby-terminal'
|
||||
|
||||
export enum SSHAlgorithmType {
|
||||
HMAC = 'hmac',
|
||||
@@ -8,7 +7,7 @@ export enum SSHAlgorithmType {
|
||||
HOSTKEY = 'serverHostKey',
|
||||
}
|
||||
|
||||
export interface SSHProfile extends Profile {
|
||||
export interface SSHProfile extends BaseTerminalProfile {
|
||||
options: SSHProfileOptions
|
||||
}
|
||||
|
||||
|
@@ -248,6 +248,11 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
|
||||
div(*ngFor='let alg of supportedAlgorithms.serverHostKey')
|
||||
checkbox([text]='alg', [(ngModel)]='algorithms.serverHostKey[alg]')
|
||||
|
||||
li(ngbNavItem)
|
||||
a(ngbNavLink, translate) Color scheme
|
||||
ng-template(ngbNavContent)
|
||||
color-scheme-selector([(model)]='profile.terminalColorScheme')
|
||||
|
||||
li(ngbNavItem)
|
||||
a(ngbNavLink, translate) Login scripts
|
||||
ng-template(ngbNavContent)
|
||||
|
@@ -19,9 +19,8 @@ import { SSHMultiplexerService } from '../services/sshMultiplexer.service'
|
||||
styles: [require('./sshTab.component.scss'), ...BaseTerminalTabComponent.styles],
|
||||
animations: BaseTerminalTabComponent.animations,
|
||||
})
|
||||
export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
export class SSHTabComponent extends BaseTerminalTabComponent<SSHProfile> {
|
||||
Platform = Platform
|
||||
profile?: SSHProfile
|
||||
sshSession: SSHSession|null = null
|
||||
session: SSHShellSession|null = null
|
||||
sftpPanelVisible = false
|
||||
@@ -45,10 +44,6 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
}
|
||||
|
||||
ngOnInit (): void {
|
||||
if (!this.profile) {
|
||||
throw new Error('Profile not set')
|
||||
}
|
||||
|
||||
this.logger = this.log.create('terminalTab')
|
||||
|
||||
this.subscribeUntilDestroyed(this.hotkeys.hotkey$, hotkey => {
|
||||
@@ -184,10 +179,6 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
}
|
||||
|
||||
private async initializeSessionMaybeMultiplex (multiplex = true): Promise<void> {
|
||||
if (!this.profile) {
|
||||
throw new Error('No SSH connection info supplied')
|
||||
}
|
||||
|
||||
this.sshSession = await this.setupOneSession(this.injector, this.profile, multiplex)
|
||||
const session = new SSHShellSession(this.injector, this.sshSession, this.profile)
|
||||
|
||||
@@ -244,13 +235,13 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
if (!this.session?.open) {
|
||||
return true
|
||||
}
|
||||
if (!(this.profile?.options.warnOnClose ?? this.config.store.ssh.warnOnClose)) {
|
||||
if (!(this.profile.options.warnOnClose ?? this.config.store.ssh.warnOnClose)) {
|
||||
return true
|
||||
}
|
||||
return (await this.platform.showMessageBox(
|
||||
{
|
||||
type: 'warning',
|
||||
message: this.translate.instant(_('Disconnect from {host}?'), this.profile?.options),
|
||||
message: this.translate.instant(_('Disconnect from {host}?'), this.profile.options),
|
||||
buttons: [
|
||||
this.translate.instant(_('Disconnect')),
|
||||
this.translate.instant(_('Do not close')),
|
||||
|
@@ -18,7 +18,7 @@ export class SFTPContextMenu extends TabContextMenuItemProvider {
|
||||
}
|
||||
|
||||
async getItems (tab: BaseTabComponent): Promise<MenuItemOptions[]> {
|
||||
if (!(tab instanceof SSHTabComponent) || !tab.profile) {
|
||||
if (!(tab instanceof SSHTabComponent)) {
|
||||
return []
|
||||
}
|
||||
const items = [{
|
||||
|
Reference in New Issue
Block a user