mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-25 13:59:52 +00:00
This commit is contained in:
parent
8b33f98c79
commit
101177a865
@ -2,7 +2,7 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
|
|
||||||
import { ConfigService, FileProvidersService, Platform, HostAppService, PromptModalComponent } from 'tabby-core'
|
import { ConfigService, FileProvidersService, Platform, HostAppService, PromptModalComponent, PartialProfile } from 'tabby-core'
|
||||||
import { LoginScriptsSettingsComponent } from 'tabby-terminal'
|
import { LoginScriptsSettingsComponent } from 'tabby-terminal'
|
||||||
import { PasswordStorageService } from '../services/passwordStorage.service'
|
import { PasswordStorageService } from '../services/passwordStorage.service'
|
||||||
import { ForwardedPortConfig, SSHAlgorithmType, SSHProfile } from '../api'
|
import { ForwardedPortConfig, SSHAlgorithmType, SSHProfile } from '../api'
|
||||||
@ -20,7 +20,7 @@ export class SSHProfileSettingsComponent {
|
|||||||
|
|
||||||
supportedAlgorithms = supportedAlgorithms
|
supportedAlgorithms = supportedAlgorithms
|
||||||
algorithms: Record<string, Record<string, boolean>> = {}
|
algorithms: Record<string, Record<string, boolean>> = {}
|
||||||
jumpHosts: SSHProfile[]
|
jumpHosts: PartialProfile<SSHProfile>[]
|
||||||
@ViewChild('loginScriptsSettings') loginScriptsSettings: LoginScriptsSettingsComponent|null
|
@ViewChild('loginScriptsSettings') loginScriptsSettings: LoginScriptsSettingsComponent|null
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
@ -2,7 +2,7 @@ import colors from 'ansi-colors'
|
|||||||
import { Component, Injector, HostListener } from '@angular/core'
|
import { Component, Injector, HostListener } from '@angular/core'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { first } from 'rxjs'
|
import { first } from 'rxjs'
|
||||||
import { Platform, RecoveryToken } from 'tabby-core'
|
import { PartialProfile, Platform, ProfilesService, RecoveryToken } from 'tabby-core'
|
||||||
import { BaseTerminalTabComponent } from 'tabby-terminal'
|
import { BaseTerminalTabComponent } from 'tabby-terminal'
|
||||||
import { SSHService } from '../services/ssh.service'
|
import { SSHService } from '../services/ssh.service'
|
||||||
import { SSHSession } from '../session/ssh'
|
import { SSHSession } from '../session/ssh'
|
||||||
@ -32,6 +32,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
injector: Injector,
|
injector: Injector,
|
||||||
public ssh: SSHService,
|
public ssh: SSHService,
|
||||||
private ngbModal: NgbModal,
|
private ngbModal: NgbModal,
|
||||||
|
private profilesService: ProfilesService,
|
||||||
) {
|
) {
|
||||||
super(injector)
|
super(injector)
|
||||||
}
|
}
|
||||||
@ -78,13 +79,16 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
|
|
||||||
async setupOneSession (session: SSHSession): Promise<void> {
|
async setupOneSession (session: SSHSession): Promise<void> {
|
||||||
if (session.profile.options.jumpHost) {
|
if (session.profile.options.jumpHost) {
|
||||||
const jumpConnection: SSHProfile|null = this.config.store.profiles.find(x => x.id === session.profile.options.jumpHost)
|
const jumpConnection: PartialProfile<SSHProfile>|null = this.config.store.profiles.find(x => x.id === session.profile.options.jumpHost)
|
||||||
|
|
||||||
if (!jumpConnection) {
|
if (!jumpConnection) {
|
||||||
throw new Error(`${session.profile.options.host}: jump host "${session.profile.options.jumpHost}" not found in your config`)
|
throw new Error(`${session.profile.options.host}: jump host "${session.profile.options.jumpHost}" not found in your config`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const jumpSession = new SSHSession(this.injector, jumpConnection)
|
const jumpSession = new SSHSession(
|
||||||
|
this.injector,
|
||||||
|
this.profilesService.getConfigProxyForProfile(jumpConnection)
|
||||||
|
)
|
||||||
|
|
||||||
await this.setupOneSession(jumpSession)
|
await this.setupOneSession(jumpSession)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user