mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-07 21:10:00 +00:00
build fix
This commit is contained in:
parent
01e3e91e51
commit
75a0aadce4
14
tabby-ssh/src/algorithms.ts
Normal file
14
tabby-ssh/src/algorithms.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { ALGORITHM_BLACKLIST, SSHAlgorithmType } from './api'
|
||||||
|
import * as ALGORITHMS from 'ssh2/lib/protocol/constants'
|
||||||
|
|
||||||
|
export const supportedAlgorithms: Record<string, string> = {}
|
||||||
|
|
||||||
|
for (const k of Object.values(SSHAlgorithmType)) {
|
||||||
|
const supportedAlg = {
|
||||||
|
[SSHAlgorithmType.KEX]: 'SUPPORTED_KEX',
|
||||||
|
[SSHAlgorithmType.HOSTKEY]: 'SUPPORTED_SERVER_HOST_KEY',
|
||||||
|
[SSHAlgorithmType.CIPHER]: 'SUPPORTED_CIPHER',
|
||||||
|
[SSHAlgorithmType.HMAC]: 'SUPPORTED_MAC',
|
||||||
|
}[k]
|
||||||
|
supportedAlgorithms[k] = ALGORITHMS[supportedAlg].filter(x => !ALGORITHM_BLACKLIST.includes(x)).sort()
|
||||||
|
}
|
@ -6,7 +6,7 @@ import { ConfigService, FileProvidersService, Platform, HostAppService, PromptMo
|
|||||||
import { LoginScriptsSettingsComponent } from 'tabby-terminal'
|
import { LoginScriptsSettingsComponent } from 'tabby-terminal'
|
||||||
import { PasswordStorageService } from '../services/passwordStorage.service'
|
import { PasswordStorageService } from '../services/passwordStorage.service'
|
||||||
import { ForwardedPortConfig, SSHAlgorithmType, SSHProfile } from '../api'
|
import { ForwardedPortConfig, SSHAlgorithmType, SSHProfile } from '../api'
|
||||||
import { SSHProfilesService } from '../profiles'
|
import { supportedAlgorithms } from '../algorithms'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
@ -18,7 +18,7 @@ export class SSHProfileSettingsComponent {
|
|||||||
hasSavedPassword: boolean
|
hasSavedPassword: boolean
|
||||||
useProxyCommand: boolean
|
useProxyCommand: boolean
|
||||||
|
|
||||||
supportedAlgorithms: Record<string, string> = {}
|
supportedAlgorithms = supportedAlgorithms
|
||||||
algorithms: Record<string, Record<string, boolean>> = {}
|
algorithms: Record<string, Record<string, boolean>> = {}
|
||||||
jumpHosts: SSHProfile[]
|
jumpHosts: SSHProfile[]
|
||||||
@ViewChild('loginScriptsSettings') loginScriptsSettings: LoginScriptsSettingsComponent|null
|
@ViewChild('loginScriptsSettings') loginScriptsSettings: LoginScriptsSettingsComponent|null
|
||||||
@ -29,10 +29,7 @@ export class SSHProfileSettingsComponent {
|
|||||||
private passwordStorage: PasswordStorageService,
|
private passwordStorage: PasswordStorageService,
|
||||||
private ngbModal: NgbModal,
|
private ngbModal: NgbModal,
|
||||||
private fileProviders: FileProvidersService,
|
private fileProviders: FileProvidersService,
|
||||||
sshProfilesService: SSHProfilesService,
|
) { }
|
||||||
) {
|
|
||||||
this.supportedAlgorithms = sshProfilesService.supportedAlgorithms
|
|
||||||
}
|
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
this.jumpHosts = this.config.store.profiles.filter(x => x.type === 'ssh' && x !== this.profile)
|
this.jumpHosts = this.config.store.profiles.filter(x => x.type === 'ssh' && x !== this.profile)
|
||||||
|
@ -4,9 +4,9 @@ import { SSHProfileSettingsComponent } from './components/sshProfileSettings.com
|
|||||||
import { SSHTabComponent } from './components/sshTab.component'
|
import { SSHTabComponent } from './components/sshTab.component'
|
||||||
import { PasswordStorageService } from './services/passwordStorage.service'
|
import { PasswordStorageService } from './services/passwordStorage.service'
|
||||||
import { ALGORITHM_BLACKLIST, SSHAlgorithmType, SSHProfile } from './api'
|
import { ALGORITHM_BLACKLIST, SSHAlgorithmType, SSHProfile } from './api'
|
||||||
|
|
||||||
import * as ALGORITHMS from 'ssh2/lib/protocol/constants'
|
import * as ALGORITHMS from 'ssh2/lib/protocol/constants'
|
||||||
|
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SSHProfilesService extends ProfileProvider<SSHProfile> {
|
export class SSHProfilesService extends ProfileProvider<SSHProfile> {
|
||||||
id = 'ssh'
|
id = 'ssh'
|
||||||
@ -41,26 +41,17 @@ export class SSHProfilesService extends ProfileProvider<SSHProfile> {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
supportedAlgorithms: Record<string, string> = {}
|
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private passwordStorage: PasswordStorageService
|
private passwordStorage: PasswordStorageService
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
for (const k of Object.values(SSHAlgorithmType)) {
|
for (const k of Object.values(SSHAlgorithmType)) {
|
||||||
const supportedAlg = {
|
|
||||||
[SSHAlgorithmType.KEX]: 'SUPPORTED_KEX',
|
|
||||||
[SSHAlgorithmType.HOSTKEY]: 'SUPPORTED_SERVER_HOST_KEY',
|
|
||||||
[SSHAlgorithmType.CIPHER]: 'SUPPORTED_CIPHER',
|
|
||||||
[SSHAlgorithmType.HMAC]: 'SUPPORTED_MAC',
|
|
||||||
}[k]
|
|
||||||
const defaultAlg = {
|
const defaultAlg = {
|
||||||
[SSHAlgorithmType.KEX]: 'DEFAULT_KEX',
|
[SSHAlgorithmType.KEX]: 'DEFAULT_KEX',
|
||||||
[SSHAlgorithmType.HOSTKEY]: 'DEFAULT_SERVER_HOST_KEY',
|
[SSHAlgorithmType.HOSTKEY]: 'DEFAULT_SERVER_HOST_KEY',
|
||||||
[SSHAlgorithmType.CIPHER]: 'DEFAULT_CIPHER',
|
[SSHAlgorithmType.CIPHER]: 'DEFAULT_CIPHER',
|
||||||
[SSHAlgorithmType.HMAC]: 'DEFAULT_MAC',
|
[SSHAlgorithmType.HMAC]: 'DEFAULT_MAC',
|
||||||
}[k]
|
}[k]
|
||||||
this.supportedAlgorithms[k] = ALGORITHMS[supportedAlg].filter(x => !ALGORITHM_BLACKLIST.includes(x)).sort()
|
|
||||||
this.configDefaults.options.algorithms[k] = ALGORITHMS[defaultAlg].filter(x => !ALGORITHM_BLACKLIST.includes(x))
|
this.configDefaults.options.algorithms[k] = ALGORITHMS[defaultAlg].filter(x => !ALGORITHM_BLACKLIST.includes(x))
|
||||||
this.configDefaults.options.algorithms[k].sort()
|
this.configDefaults.options.algorithms[k].sort()
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import TabbyCorePlugin, { ProfileProvider, AppService } from 'tabby-core'
|
|||||||
import TabbyTerminalModule from 'tabby-terminal'
|
import TabbyTerminalModule from 'tabby-terminal'
|
||||||
|
|
||||||
import { DemoTerminalTabComponent } from './components/terminalTab.component'
|
import { DemoTerminalTabComponent } from './components/terminalTab.component'
|
||||||
import { DemoProfilesService } from 'profiles'
|
import { DemoProfilesService } from './profiles'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { Injector, NgZone } from '@angular/core'
|
import { Injector, NgZone } from '@angular/core'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import { BaseSession } from 'tabby-terminal'
|
import { BaseSession } from 'tabby-terminal'
|
||||||
import { Logger } from '../../tabby-core/typings'
|
import { Logger } from 'tabby-core'
|
||||||
|
|
||||||
const currentScript: any = document.currentScript
|
const currentScript: any = document.currentScript
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export class Session extends BaseSession {
|
|||||||
Session.v86Loaded = true
|
Session.v86Loaded = true
|
||||||
}
|
}
|
||||||
script.src = `${this.dataPath}/v86_all.js`
|
script.src = `${this.dataPath}/v86_all.js`
|
||||||
document.querySelector('head').appendChild(script)
|
document.querySelector('head')?.appendChild(script)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ export class Session extends BaseSession {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
getWorkingDirectory (): Promise<string | null> {
|
async getWorkingDirectory (): Promise<string | null> {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src"
|
||||||
"module": "commonjs",
|
}
|
||||||
"target": "es2016",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"noImplicitAny": false,
|
|
||||||
"removeComments": false,
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"noUnusedParameters": true,
|
|
||||||
"noImplicitReturns": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"declaration": true,
|
|
||||||
"declarationDir": "dist",
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"es2015",
|
|
||||||
"es7"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"exclude": ["node_modules", "dist"]
|
|
||||||
}
|
}
|
||||||
|
@ -1,42 +1,5 @@
|
|||||||
const path = require('path')
|
const config = require('../webpack.plugin.config')
|
||||||
|
module.exports = config({
|
||||||
module.exports = {
|
name: 'web-demo',
|
||||||
target: 'node',
|
dirname: __dirname,
|
||||||
entry: 'src/index.ts',
|
})
|
||||||
devtool: 'source-map',
|
|
||||||
context: __dirname,
|
|
||||||
mode: 'development',
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, 'dist'),
|
|
||||||
filename: 'index.js',
|
|
||||||
pathinfo: true,
|
|
||||||
libraryTarget: 'umd',
|
|
||||||
devtoolModuleFilenameTemplate: 'webpack-tabby-demo:///[resource-path]',
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
modules: ['.', 'src', 'node_modules'].map(x => path.join(__dirname, x)),
|
|
||||||
extensions: ['.ts', '.js'],
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.ts$/,
|
|
||||||
loader: 'ts-loader',
|
|
||||||
options: {
|
|
||||||
configFile: path.resolve(__dirname, 'tsconfig.json'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
|
|
||||||
{ test: /\.svg/, use: ['svg-inline-loader'] },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
externals: [
|
|
||||||
'fs',
|
|
||||||
'ngx-toastr',
|
|
||||||
'path',
|
|
||||||
/^rxjs/,
|
|
||||||
/^@angular/,
|
|
||||||
/^@ng-bootstrap/,
|
|
||||||
/^tabby-/,
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user