Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix#9262: Jump host selection shows group id instead of group name #9264

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tabby-ssh/src/components/sshProfileSettings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, ViewChild } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
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 { PasswordStorageService } from '../services/passwordStorage.service'
import { ForwardedPortConfig, SSHAlgorithmType, SSHProfile } from '../api'
Expand All @@ -27,14 +27,14 @@ export class SSHProfileSettingsComponent {

constructor (
public hostApp: HostAppService,
private config: ConfigService,
private profilesService: ProfilesService,
private passwordStorage: PasswordStorageService,
private ngbModal: NgbModal,
private fileProviders: FileProvidersService,
) { }

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)))

for (const k of Object.values(SSHAlgorithmType)) {
Expand Down Expand Up @@ -67,7 +67,7 @@ export class SSHProfileSettingsComponent {
}

getJumpHostLabel (p: PartialProfile<SSHProfile>) {
return p.group ? `${p.group} / ${p.name}` : p.name
return p.group ? `${this.profilesService.resolveProfileGroupName(p.group)} / ${p.name}` : p.name
}

async setPassword () {
Expand Down