1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-25 19:17:39 +03:00

ref(ssh): use ProfilesService instead of ConfigService in profile settings

This commit is contained in:
Clem Fern 2023-11-21 21:43:03 +01:00
parent 38c9714c75
commit 3794081cef

View File

@ -3,7 +3,7 @@ import { Component, ViewChild } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { firstBy } from 'thenby' import { firstBy } from 'thenby'
import { ConfigService, FileProvidersService, Platform, HostAppService, PromptModalComponent, PartialProfile } from 'tabby-core' import { FileProvidersService, Platform, HostAppService, PromptModalComponent, PartialProfile, ProfilesService } 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'
@ -27,14 +27,14 @@ export class SSHProfileSettingsComponent {
constructor ( constructor (
public hostApp: HostAppService, public hostApp: HostAppService,
private config: ConfigService, private profilesService: ProfilesService,
private passwordStorage: PasswordStorageService, private passwordStorage: PasswordStorageService,
private ngbModal: NgbModal, private ngbModal: NgbModal,
private fileProviders: FileProvidersService, private fileProviders: FileProvidersService,
) { } ) { }
async ngOnInit () { async ngOnInit () {
this.jumpHosts = this.config.store.profiles.filter(x => x.type === 'ssh' && x !== this.profile) this.jumpHosts = (await this.profilesService.getProfiles({ includeBuiltin: false })).filter(x => x.type === 'ssh' && x !== this.profile)
this.jumpHosts.sort(firstBy(x => this.getJumpHostLabel(x))) this.jumpHosts.sort(firstBy(x => this.getJumpHostLabel(x)))
for (const k of Object.values(SSHAlgorithmType)) { for (const k of Object.values(SSHAlgorithmType)) {