mirror of
https://github.com/Eugeny/tabby.git
synced 2025-04-18 16:20:27 +08:00
This commit is contained in:
parent
8b33f98c79
commit
101177a865
@ -2,7 +2,7 @@
|
||||
import { Component, ViewChild } from '@angular/core'
|
||||
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 { PasswordStorageService } from '../services/passwordStorage.service'
|
||||
import { ForwardedPortConfig, SSHAlgorithmType, SSHProfile } from '../api'
|
||||
@ -20,7 +20,7 @@ export class SSHProfileSettingsComponent {
|
||||
|
||||
supportedAlgorithms = supportedAlgorithms
|
||||
algorithms: Record<string, Record<string, boolean>> = {}
|
||||
jumpHosts: SSHProfile[]
|
||||
jumpHosts: PartialProfile<SSHProfile>[]
|
||||
@ViewChild('loginScriptsSettings') loginScriptsSettings: LoginScriptsSettingsComponent|null
|
||||
|
||||
constructor (
|
||||
|
@ -2,7 +2,7 @@ import colors from 'ansi-colors'
|
||||
import { Component, Injector, HostListener } from '@angular/core'
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { first } from 'rxjs'
|
||||
import { Platform, RecoveryToken } from 'tabby-core'
|
||||
import { PartialProfile, Platform, ProfilesService, RecoveryToken } from 'tabby-core'
|
||||
import { BaseTerminalTabComponent } from 'tabby-terminal'
|
||||
import { SSHService } from '../services/ssh.service'
|
||||
import { SSHSession } from '../session/ssh'
|
||||
@ -32,6 +32,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
injector: Injector,
|
||||
public ssh: SSHService,
|
||||
private ngbModal: NgbModal,
|
||||
private profilesService: ProfilesService,
|
||||
) {
|
||||
super(injector)
|
||||
}
|
||||
@ -78,13 +79,16 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
|
||||
async setupOneSession (session: SSHSession): Promise<void> {
|
||||
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) {
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user