diff --git a/package.json b/package.json index 72edaceb..617109f7 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "graceful-fs": "^4.2.9", "html-loader": "3.1.0", "json-loader": "^0.5.7", + "thenby": "^1.3.4", "lru-cache": "^6.0.0", "macos-release": "^3.0.1", "ngx-sortablejs": "^11.1.0", diff --git a/tabby-core/package.json b/tabby-core/package.json index 89bed148..a420ff80 100644 --- a/tabby-core/package.json +++ b/tabby-core/package.json @@ -27,7 +27,6 @@ "ngx-perfect-scrollbar": "^10.1.0", "ngx-translate-messageformat-compiler": "^4.11.0", "readable-stream": "3.6.0", - "thenby": "^1.3.4", "uuid": "^8.0.0" }, "peerDependencies": { diff --git a/tabby-core/yarn.lock b/tabby-core/yarn.lock index 2d7c0b07..89251ae3 100644 --- a/tabby-core/yarn.lock +++ b/tabby-core/yarn.lock @@ -161,11 +161,6 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -thenby@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/thenby/-/thenby-1.3.4.tgz#81581f6e1bb324c6dedeae9bfc28e59b1a2201cc" - integrity sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ== - tslib@^1.10.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" diff --git a/tabby-ssh/src/components/sshProfileSettings.component.pug b/tabby-ssh/src/components/sshProfileSettings.component.pug index 57aa248a..6c630a9d 100644 --- a/tabby-ssh/src/components/sshProfileSettings.component.pug +++ b/tabby-ssh/src/components/sshProfileSettings.component.pug @@ -61,7 +61,7 @@ ul.nav-tabs(ngbNav, #nav='ngbNav') label(translate) Jump host select.form-control([(ngModel)]='profile.options.jumpHost') option([ngValue]='null', translate) Select - option([ngValue]='x.id', *ngFor='let x of jumpHosts') {{x.name}} + option([ngValue]='x.id', *ngFor='let x of jumpHosts') {{getJumpHostLabel(x)}} .d-flex.w-100(*ngIf='connectionMode === "socksProxy"') diff --git a/tabby-ssh/src/components/sshProfileSettings.component.ts b/tabby-ssh/src/components/sshProfileSettings.component.ts index 5d3dc35e..659e98e5 100644 --- a/tabby-ssh/src/components/sshProfileSettings.component.ts +++ b/tabby-ssh/src/components/sshProfileSettings.component.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 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 { LoginScriptsSettingsComponent } from 'tabby-terminal' @@ -34,6 +35,8 @@ export class SSHProfileSettingsComponent { async ngOnInit () { this.jumpHosts = this.config.store.profiles.filter(x => x.type === 'ssh' && x !== this.profile) + this.jumpHosts.sort(firstBy(x => this.getJumpHostLabel(x))) + for (const k of Object.values(SSHAlgorithmType)) { this.algorithms[k] = {} for (const alg of this.profile.options.algorithms?.[k] ?? []) { @@ -63,6 +66,10 @@ export class SSHProfileSettingsComponent { } } + getJumpHostLabel (p: PartialProfile) { + return p.group ? `${p.group} / ${p.name}` : p.name + } + async setPassword () { const modal = this.ngbModal.open(PromptModalComponent) modal.componentInstance.prompt = `Password for ${this.profile.options.user}@${this.profile.options.host}` diff --git a/yarn.lock b/yarn.lock index 4677fdc9..1c47d6e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8143,6 +8143,11 @@ text-table@^0.2.0, text-table@~0.2.0: resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +thenby@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/thenby/-/thenby-1.3.4.tgz#81581f6e1bb324c6dedeae9bfc28e59b1a2201cc" + integrity sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ== + throttleit@0.0.2: version "0.0.2" resolved "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz"