|
|
@@ -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<SSHProfile>) {
|
|
|
+ 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}`
|