mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 05:54:57 +00:00
electron 11 cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "terminus-ssh",
|
||||
"version": "1.0.104-nightly.0",
|
||||
"version": "1.0.123-nightly.0",
|
||||
"description": "SSH connection manager for Terminus",
|
||||
"keywords": [
|
||||
"terminus-builtin-plugin"
|
||||
|
@@ -18,7 +18,7 @@ export enum SSHAlgorithmType {
|
||||
HMAC = 'hmac',
|
||||
KEX = 'kex',
|
||||
CIPHER = 'cipher',
|
||||
HOSTKEY = 'serverHostKey'
|
||||
HOSTKEY = 'serverHostKey',
|
||||
}
|
||||
|
||||
export interface SSHConnection {
|
||||
@@ -45,7 +45,7 @@ export interface SSHConnection {
|
||||
}
|
||||
|
||||
export enum PortForwardType {
|
||||
Local, Remote, Dynamic
|
||||
Local, Remote, Dynamic,
|
||||
}
|
||||
|
||||
export class ForwardedPort {
|
||||
@@ -230,11 +230,11 @@ export class SSHSession extends BaseSession {
|
||||
|
||||
this.ssh.on('x11', (details, accept, reject) => {
|
||||
this.logger.info(`Incoming X11 connection from ${details.srcIP}:${details.srcPort}`)
|
||||
let displaySpec = process.env.DISPLAY || ':0'
|
||||
const displaySpec = process.env.DISPLAY || ':0'
|
||||
this.logger.debug(`Trying display ${displaySpec}`)
|
||||
let xHost = displaySpec.split(':')[0]
|
||||
let xDisplay = parseInt(displaySpec.split(':')[1].split('.')[0] || '0')
|
||||
let xPort = xDisplay < 100 ? xDisplay + 6000 : xDisplay
|
||||
const xHost = displaySpec.split(':')[0]
|
||||
const xDisplay = parseInt(displaySpec.split(':')[1].split('.')[0] || '0')
|
||||
const xPort = xDisplay < 100 ? xDisplay + 6000 : xDisplay
|
||||
|
||||
const socket = displaySpec.startsWith('/') ? createConnection(displaySpec) : new Socket()
|
||||
if (!displaySpec.startsWith('/')) {
|
||||
|
@@ -14,7 +14,7 @@ import { Subscription } from 'rxjs'
|
||||
/** @hidden */
|
||||
@Component({
|
||||
selector: 'ssh-tab',
|
||||
template: BaseTerminalTabComponent.template + require<string>('./sshTab.component.pug'),
|
||||
template: BaseTerminalTabComponent.template + (require('./sshTab.component.pug') as string),
|
||||
styles: [require('./sshTab.component.scss'), ...BaseTerminalTabComponent.styles],
|
||||
animations: BaseTerminalTabComponent.animations,
|
||||
})
|
||||
@@ -91,7 +91,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||
|
||||
|
||||
session.serviceMessage$.subscribe(msg => {
|
||||
this.write('\r\n' + colors.black.bgWhite(' SSH ') + ' ' + msg + '\r\n')
|
||||
this.write(`\r\n${colors.black.bgWhite(' SSH ')} ${msg}\r\n`)
|
||||
session.resize(this.size.columns, this.size.rows)
|
||||
})
|
||||
|
||||
|
@@ -87,7 +87,7 @@ export class SSHService {
|
||||
try {
|
||||
const result = await modal.result
|
||||
passphrase = result?.value
|
||||
} catch (e) { }
|
||||
} catch { }
|
||||
parsedKey = sshpk.parsePrivateKey(
|
||||
privateKey,
|
||||
'auto',
|
||||
@@ -269,7 +269,7 @@ export class SSHService {
|
||||
sock: session.jumpStream,
|
||||
authHandler: methodsLeft => {
|
||||
while (true) {
|
||||
let method = authMethodsLeft.shift()
|
||||
const method = authMethodsLeft.shift()
|
||||
if (!method) {
|
||||
return false
|
||||
}
|
||||
@@ -348,8 +348,8 @@ export class SSHService {
|
||||
})
|
||||
}
|
||||
|
||||
let groups: { name: string, connections: SSHConnection[] }[] = []
|
||||
let connections = this.config.store.ssh.connections
|
||||
const groups: { name: string, connections: SSHConnection[] }[] = []
|
||||
const connections = this.config.store.ssh.connections
|
||||
for (const connection of connections) {
|
||||
connection.group = connection.group || null
|
||||
let group = groups.find(x => x.name === connection.group)
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import type { MenuItemConstructorOptions } from 'electron'
|
||||
import { execFile } from 'child_process'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { ConfigService, BaseTabComponent, TabContextMenuItemProvider, TabHeaderComponent, HostAppService, Platform } from 'terminus-core'
|
||||
@@ -36,7 +37,7 @@ export class WinSCPContextMenu extends TabContextMenuItemProvider {
|
||||
}
|
||||
}
|
||||
|
||||
async getItems (tab: BaseTabComponent, tabHeader?: TabHeaderComponent): Promise<Electron.MenuItemConstructorOptions[]> {
|
||||
async getItems (tab: BaseTabComponent, tabHeader?: TabHeaderComponent): Promise<MenuItemConstructorOptions[]> {
|
||||
if (this.hostApp.platform !== Platform.Windows || tabHeader) {
|
||||
return []
|
||||
}
|
||||
@@ -75,7 +76,7 @@ export class WinSCPContextMenu extends TabContextMenuItemProvider {
|
||||
if (!path) {
|
||||
return
|
||||
}
|
||||
let args = [await this.getURI(connection)]
|
||||
const args = [await this.getURI(connection)]
|
||||
if ((!connection.auth || connection.auth === 'publicKey') && connection.privateKey) {
|
||||
args.push('/privatekey')
|
||||
args.push(connection.privateKey)
|
||||
|
Reference in New Issue
Block a user