mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 14:04:56 +00:00
added an option to reuse private keys stored in the vault
This commit is contained in:
@@ -3,6 +3,7 @@ import colors from 'ansi-colors'
|
||||
import { Spinner } from 'cli-spinner'
|
||||
import { Component, Injector } from '@angular/core'
|
||||
import { first } from 'rxjs/operators'
|
||||
import { SelectorService } from 'terminus-core'
|
||||
import { BaseTerminalTabComponent } from 'terminus-terminal'
|
||||
import { SerialService } from '../services/serial.service'
|
||||
import { SerialConnection, SerialSession, BAUD_RATES } from '../api'
|
||||
@@ -23,6 +24,7 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
|
||||
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
||||
constructor (
|
||||
injector: Injector,
|
||||
private selector: SelectorService,
|
||||
) {
|
||||
super(injector)
|
||||
this.serialService = injector.get(SerialService)
|
||||
@@ -122,7 +124,7 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
|
||||
}
|
||||
|
||||
async changeBaudRate () {
|
||||
const rate = await this.app.showSelector('Baud rate', BAUD_RATES.map(x => ({
|
||||
const rate = await this.selector.show('Baud rate', BAUD_RATES.map(x => ({
|
||||
name: x.toString(), result: x,
|
||||
})))
|
||||
this.serialPort.update({ baudRate: rate })
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Injectable, NgZone } from '@angular/core'
|
||||
import SerialPort from 'serialport'
|
||||
import { LogService, AppService, SelectorOption, ConfigService, NotificationsService } from 'terminus-core'
|
||||
import { LogService, AppService, SelectorOption, ConfigService, NotificationsService, SelectorService } from 'terminus-core'
|
||||
import { SettingsTabComponent } from 'terminus-settings'
|
||||
import { SerialConnection, SerialSession, SerialPortInfo, BAUD_RATES } from '../api'
|
||||
import { SerialTabComponent } from '../components/serialTab.component'
|
||||
@@ -12,6 +12,7 @@ export class SerialService {
|
||||
private zone: NgZone,
|
||||
private notifications: NotificationsService,
|
||||
private app: AppService,
|
||||
private selector: SelectorService,
|
||||
private config: ConfigService,
|
||||
) { }
|
||||
|
||||
@@ -124,7 +125,7 @@ export class SerialService {
|
||||
})
|
||||
|
||||
|
||||
await this.app.showSelector('Open a serial port', options)
|
||||
await this.selector.show('Open a serial port', options)
|
||||
}
|
||||
|
||||
async connect (connection: SerialConnection): Promise<SerialTabComponent> {
|
||||
@@ -170,7 +171,7 @@ export class SerialService {
|
||||
}
|
||||
|
||||
async connectFoundPort (port: SerialPortInfo): Promise<SerialTabComponent> {
|
||||
const rate = await this.app.showSelector('Baud rate', BAUD_RATES.map(x => ({
|
||||
const rate = await this.selector.show('Baud rate', BAUD_RATES.map(x => ({
|
||||
name: x.toString(), result: x,
|
||||
})))
|
||||
return this.quickConnect(`${port.name}@${rate}`)
|
||||
|
Reference in New Issue
Block a user