build fix

This commit is contained in:
Eugene Pankov 2021-07-24 20:18:52 +02:00
parent 01e3e91e51
commit 75a0aadce4
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
7 changed files with 31 additions and 84 deletions

View 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()
}

View File

@ -6,7 +6,7 @@ import { ConfigService, FileProvidersService, Platform, HostAppService, PromptMo
import { LoginScriptsSettingsComponent } from 'tabby-terminal'
import { PasswordStorageService } from '../services/passwordStorage.service'
import { ForwardedPortConfig, SSHAlgorithmType, SSHProfile } from '../api'
import { SSHProfilesService } from '../profiles'
import { supportedAlgorithms } from '../algorithms'
/** @hidden */
@Component({
@ -18,7 +18,7 @@ export class SSHProfileSettingsComponent {
hasSavedPassword: boolean
useProxyCommand: boolean
supportedAlgorithms: Record<string, string> = {}
supportedAlgorithms = supportedAlgorithms
algorithms: Record<string, Record<string, boolean>> = {}
jumpHosts: SSHProfile[]
@ViewChild('loginScriptsSettings') loginScriptsSettings: LoginScriptsSettingsComponent|null
@ -29,10 +29,7 @@ export class SSHProfileSettingsComponent {
private passwordStorage: PasswordStorageService,
private ngbModal: NgbModal,
private fileProviders: FileProvidersService,
sshProfilesService: SSHProfilesService,
) {
this.supportedAlgorithms = sshProfilesService.supportedAlgorithms
}
) { }
async ngOnInit () {
this.jumpHosts = this.config.store.profiles.filter(x => x.type === 'ssh' && x !== this.profile)

View File

@ -4,9 +4,9 @@ import { SSHProfileSettingsComponent } from './components/sshProfileSettings.com
import { SSHTabComponent } from './components/sshTab.component'
import { PasswordStorageService } from './services/passwordStorage.service'
import { ALGORITHM_BLACKLIST, SSHAlgorithmType, SSHProfile } from './api'
import * as ALGORITHMS from 'ssh2/lib/protocol/constants'
@Injectable({ providedIn: 'root' })
export class SSHProfilesService extends ProfileProvider<SSHProfile> {
id = 'ssh'
@ -41,26 +41,17 @@ export class SSHProfilesService extends ProfileProvider<SSHProfile> {
},
}
supportedAlgorithms: Record<string, string> = {}
constructor (
private passwordStorage: PasswordStorageService
) {
super()
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 = {
[SSHAlgorithmType.KEX]: 'DEFAULT_KEX',
[SSHAlgorithmType.HOSTKEY]: 'DEFAULT_SERVER_HOST_KEY',
[SSHAlgorithmType.CIPHER]: 'DEFAULT_CIPHER',
[SSHAlgorithmType.HMAC]: 'DEFAULT_MAC',
}[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].sort()
}

View File

@ -7,7 +7,7 @@ import TabbyCorePlugin, { ProfileProvider, AppService } from 'tabby-core'
import TabbyTerminalModule from 'tabby-terminal'
import { DemoTerminalTabComponent } from './components/terminalTab.component'
import { DemoProfilesService } from 'profiles'
import { DemoProfilesService } from './profiles'
/** @hidden */
@NgModule({

View File

@ -2,7 +2,7 @@
import { Injector, NgZone } from '@angular/core'
import * as path from 'path'
import { BaseSession } from 'tabby-terminal'
import { Logger } from '../../tabby-core/typings'
import { Logger } from 'tabby-core'
const currentScript: any = document.currentScript
@ -32,7 +32,7 @@ export class Session extends BaseSession {
Session.v86Loaded = true
}
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
}
getWorkingDirectory (): Promise<string | null> {
async getWorkingDirectory (): Promise<string | null> {
return null
}
}

View File

@ -1,25 +1,7 @@
{
"extends": "../tsconfig.json",
"exclude": ["node_modules", "dist", "typings"],
"compilerOptions": {
"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"]
"baseUrl": "src"
}
}

View File

@ -1,42 +1,5 @@
const path = require('path')
module.exports = {
target: 'node',
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-/,
],
}
const config = require('../webpack.plugin.config')
module.exports = config({
name: 'web-demo',
dirname: __dirname,
})