mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-28 16:08:35 +00:00
bumped eslint
This commit is contained in:
@@ -5,8 +5,15 @@ parserOptions:
|
|||||||
- '*/tsconfig.typings.json'
|
- '*/tsconfig.typings.json'
|
||||||
extends:
|
extends:
|
||||||
- 'plugin:@typescript-eslint/all'
|
- 'plugin:@typescript-eslint/all'
|
||||||
|
- plugin:import/recommended
|
||||||
|
- plugin:import/typescript
|
||||||
plugins:
|
plugins:
|
||||||
- '@typescript-eslint'
|
- '@typescript-eslint'
|
||||||
|
- 'import'
|
||||||
|
settings:
|
||||||
|
import/resolver:
|
||||||
|
typescript: true
|
||||||
|
node: true
|
||||||
env:
|
env:
|
||||||
browser: true
|
browser: true
|
||||||
es6: true
|
es6: true
|
||||||
@@ -126,3 +133,11 @@ rules:
|
|||||||
- allowAliases: in-unions-and-intersections
|
- allowAliases: in-unions-and-intersections
|
||||||
allowLiterals: always
|
allowLiterals: always
|
||||||
allowCallbacks: always
|
allowCallbacks: always
|
||||||
|
'@typescript-eslint/sort-type-constituents': off
|
||||||
|
'@typescript-eslint/parameter-properties':
|
||||||
|
- error
|
||||||
|
- prefer: parameter-property
|
||||||
|
'import/no-named-as-default-member': off
|
||||||
|
'@typescript-eslint/consistent-type-exports': off
|
||||||
|
'@typescript-eslint/consistent-generic-constructors': off
|
||||||
|
'keyword-spacing': off
|
||||||
|
16
package.json
16
package.json
@@ -23,8 +23,8 @@
|
|||||||
"@types/node": "16.0.1",
|
"@types/node": "16.0.1",
|
||||||
"@types/sortablejs": "^1.15.0",
|
"@types/sortablejs": "^1.15.0",
|
||||||
"@types/webpack-env": "^1.18.0",
|
"@types/webpack-env": "^1.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||||
"@typescript-eslint/parser": "^4.33.0",
|
"@typescript-eslint/parser": "^5.45.0",
|
||||||
"apply-loader": "2.0.0",
|
"apply-loader": "2.0.0",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"browserify-sign": "^4.2.1",
|
"browserify-sign": "^4.2.1",
|
||||||
@@ -41,7 +41,9 @@
|
|||||||
"electron-installer-snap": "^5.1.0",
|
"electron-installer-snap": "^5.1.0",
|
||||||
"electron-notarize": "^1.2.2",
|
"electron-notarize": "^1.2.2",
|
||||||
"electron-rebuild": "^3.2.9",
|
"electron-rebuild": "^3.2.9",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^8.29.0",
|
||||||
|
"eslint-import-resolver-typescript": "^3.5.2",
|
||||||
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"gettext-extractor": "^3.5.4",
|
"gettext-extractor": "^3.5.4",
|
||||||
"graceful-fs": "^4.2.10",
|
"graceful-fs": "^4.2.10",
|
||||||
@@ -76,15 +78,15 @@
|
|||||||
"style-loader": "^3.3.1",
|
"style-loader": "^3.3.1",
|
||||||
"svg-inline-loader": "^0.8.2",
|
"svg-inline-loader": "^0.8.2",
|
||||||
"thenby": "^1.3.4",
|
"thenby": "^1.3.4",
|
||||||
"ts-loader": "^9.4.1",
|
"ts-loader": "^9.4.2",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"typedoc": "^0.22.18",
|
"typedoc": "^0.22.18",
|
||||||
"typescript": "^4.3.5",
|
"typescript": "^4.3.5",
|
||||||
"utils-decorators": "^1.10.4",
|
"utils-decorators": "^1.10.4",
|
||||||
"val-loader": "4.0.0",
|
"val-loader": "4.0.0",
|
||||||
"webpack": "^5.72.1",
|
"webpack": "^5.75.0",
|
||||||
"webpack-bundle-analyzer": "^4.5.0",
|
"webpack-bundle-analyzer": "^4.7.0",
|
||||||
"webpack-cli": "^4.9.2",
|
"webpack-cli": "^5.0.0",
|
||||||
"yaml-loader": "0.6.0",
|
"yaml-loader": "0.6.0",
|
||||||
"zone.js": "^0.11.5"
|
"zone.js": "^0.11.5"
|
||||||
},
|
},
|
||||||
|
@@ -12,7 +12,7 @@ export class RenameTabModalComponent {
|
|||||||
@ViewChild('input') input: ElementRef
|
@ViewChild('input') input: ElementRef
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private modalInstance: NgbActiveModal
|
private modalInstance: NgbActiveModal,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
@@ -64,7 +64,7 @@ export class SelectorModalComponent<T> {
|
|||||||
this.filteredOptions = this.options.slice().sort(
|
this.filteredOptions = this.options.slice().sort(
|
||||||
firstBy<SelectorOption<T>, number>(x => x.weight ?? 0)
|
firstBy<SelectorOption<T>, number>(x => x.weight ?? 0)
|
||||||
.thenBy<SelectorOption<T>, string>(x => x.group ?? '')
|
.thenBy<SelectorOption<T>, string>(x => x.group ?? '')
|
||||||
.thenBy<SelectorOption<T>, string>(x => x.name)
|
.thenBy<SelectorOption<T>, string>(x => x.name),
|
||||||
)
|
)
|
||||||
.filter(x => !x.freeInputPattern)
|
.filter(x => !x.freeInputPattern)
|
||||||
} else {
|
} else {
|
||||||
|
@@ -74,7 +74,7 @@ export class SplitTabPaneLabelComponent extends SelfPositioningComponent {
|
|||||||
tabElement.offsetTop,
|
tabElement.offsetTop,
|
||||||
tabElement.clientWidth,
|
tabElement.clientWidth,
|
||||||
tabElement.clientHeight,
|
tabElement.clientHeight,
|
||||||
'px'
|
'px',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -77,14 +77,14 @@ export class SplitTabSpannerComponent extends SelfPositioningComponent {
|
|||||||
this.container.x,
|
this.container.x,
|
||||||
this.container.y + this.container.h * this.container.getOffsetRatio(this.index),
|
this.container.y + this.container.h * this.container.getOffsetRatio(this.index),
|
||||||
this.container.w,
|
this.container.w,
|
||||||
0
|
0,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
this.setDimensions(
|
this.setDimensions(
|
||||||
this.container.x + this.container.w * this.container.getOffsetRatio(this.index),
|
this.container.x + this.container.w * this.container.getOffsetRatio(this.index),
|
||||||
this.container.y,
|
this.container.y,
|
||||||
0,
|
0,
|
||||||
this.container.h
|
this.container.h,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,7 @@ export class ConfigProxy {
|
|||||||
enumerable: true,
|
enumerable: true,
|
||||||
configurable: false,
|
configurable: false,
|
||||||
get: () => proxy,
|
get: () => proxy,
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Object.defineProperty(
|
Object.defineProperty(
|
||||||
@@ -54,7 +54,7 @@ export class ConfigProxy {
|
|||||||
set: (value) => {
|
set: (value) => {
|
||||||
this.__setValue(key, value)
|
this.__setValue(key, value)
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@ export class FileProvidersService {
|
|||||||
providers.map(p => ({
|
providers.map(p => ({
|
||||||
name: p.name,
|
name: p.name,
|
||||||
result: p,
|
result: p,
|
||||||
}))
|
})),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ export class HomeBaseService {
|
|||||||
if (!window.localStorage.analyticsUserID) {
|
if (!window.localStorage.analyticsUserID) {
|
||||||
window.localStorage.analyticsUserID = uuidv4()
|
window.localStorage.analyticsUserID = uuidv4()
|
||||||
}
|
}
|
||||||
this.mixpanel = mixpanel.init('bb4638b0860eef14c04d4fbc5eb365fa')
|
this.mixpanel = (mixpanel as any).init('bb4638b0860eef14c04d4fbc5eb365fa')
|
||||||
if (!window.localStorage.installEventSent) {
|
if (!window.localStorage.installEventSent) {
|
||||||
this.mixpanel.track('freshInstall', this.getAnalyticsProperties())
|
this.mixpanel.track('freshInstall', this.getAnalyticsProperties())
|
||||||
window.localStorage.installEventSent = true
|
window.localStorage.installEventSent = true
|
||||||
|
@@ -218,7 +218,7 @@ export class HotkeysService {
|
|||||||
let matched = true
|
let matched = true
|
||||||
for (const item of sequence) {
|
for (const item of sequence) {
|
||||||
const nextOffset = currentSequence.slice(lastIndex).findIndex(
|
const nextOffset = currentSequence.slice(lastIndex).findIndex(
|
||||||
x => x.toLowerCase() === item.toLowerCase()
|
x => x.toLowerCase() === item.toLowerCase(),
|
||||||
)
|
)
|
||||||
if (nextOffset === -1) {
|
if (nextOffset === -1) {
|
||||||
matched = false
|
matched = false
|
||||||
@@ -274,7 +274,7 @@ export class HotkeysService {
|
|||||||
return (
|
return (
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
this.config.enabledServices(this.hotkeyProviders)
|
this.config.enabledServices(this.hotkeyProviders)
|
||||||
.map(async x => x.provide())
|
.map(async x => x.provide()),
|
||||||
)
|
)
|
||||||
).reduce((a, b) => a.concat(b))
|
).reduce((a, b) => a.concat(b))
|
||||||
}
|
}
|
||||||
|
@@ -67,7 +67,7 @@ export class TranslateServiceWrapper extends TranslateService {
|
|||||||
}
|
}
|
||||||
this.translations[this.defaultLang][key] ??= this.compiler.compile(
|
this.translations[this.defaultLang][key] ??= this.compiler.compile(
|
||||||
this._defaultTranslation[key] || key,
|
this._defaultTranslation[key] || key,
|
||||||
this.defaultLang
|
this.defaultLang,
|
||||||
)
|
)
|
||||||
return super.getParsedResult(translations, key, interpolateParams ?? {})
|
return super.getParsedResult(translations, key, interpolateParams ?? {})
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ export class TabRecoveryService {
|
|||||||
private constructor (
|
private constructor (
|
||||||
@Inject(TabRecoveryProvider) private tabRecoveryProviders: TabRecoveryProvider<BaseTabComponent>[]|null,
|
@Inject(TabRecoveryProvider) private tabRecoveryProviders: TabRecoveryProvider<BaseTabComponent>[]|null,
|
||||||
private config: ConfigService,
|
private config: ConfigService,
|
||||||
log: LogService
|
log: LogService,
|
||||||
) {
|
) {
|
||||||
this.logger = log.create('tabRecovery')
|
this.logger = log.create('tabRecovery')
|
||||||
}
|
}
|
||||||
@@ -25,8 +25,8 @@ export class TabRecoveryService {
|
|||||||
}
|
}
|
||||||
window.localStorage.tabsRecovery = JSON.stringify(
|
window.localStorage.tabsRecovery = JSON.stringify(
|
||||||
(await Promise.all(
|
(await Promise.all(
|
||||||
tabs.map(async tab => this.getFullRecoveryToken(tab, { includeState: true }))
|
tabs.map(async tab => this.getFullRecoveryToken(tab, { includeState: true })),
|
||||||
)).filter(token => !!token)
|
)).filter(token => !!token),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -34,15 +34,9 @@ export function wrapPromise <T> (zone: NgZone, promise: Promise<T>): Promise<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ResettableTimeout {
|
export class ResettableTimeout {
|
||||||
private fn: () => void
|
private id: any = null
|
||||||
private timeout: number
|
|
||||||
private id: any
|
|
||||||
|
|
||||||
constructor (fn: () => void, timeout: number) {
|
constructor (private fn: () => void, private timeout: number) {}
|
||||||
this.fn = fn
|
|
||||||
this.timeout = timeout
|
|
||||||
this.id = null
|
|
||||||
}
|
|
||||||
|
|
||||||
set (timeout?: number): void {
|
set (timeout?: number): void {
|
||||||
this.clear()
|
this.clear()
|
||||||
|
@@ -78,7 +78,7 @@ export class ElectronDockingService extends DockingService {
|
|||||||
getScreens (): Screen[] {
|
getScreens (): Screen[] {
|
||||||
const primaryDisplayID = this.electron.screen.getPrimaryDisplay().id
|
const primaryDisplayID = this.electron.screen.getPrimaryDisplay().id
|
||||||
return this.electron.screen.getAllDisplays().sort((a, b) =>
|
return this.electron.screen.getAllDisplays().sort((a, b) =>
|
||||||
a.bounds.x === b.bounds.x ? a.bounds.y - b.bounds.y : a.bounds.x - b.bounds.x
|
a.bounds.x === b.bounds.x ? a.bounds.y - b.bounds.y : a.bounds.x - b.bounds.x,
|
||||||
).map((display, index) => {
|
).map((display, index) => {
|
||||||
return {
|
return {
|
||||||
...display,
|
...display,
|
||||||
|
@@ -135,7 +135,7 @@ export class ElectronUpdaterService extends UpdaterService {
|
|||||||
],
|
],
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0) {
|
)).response === 0) {
|
||||||
await this.downloaded
|
await this.downloaded
|
||||||
this.autoUpdater.quitAndInstall()
|
this.autoUpdater.quitAndInstall()
|
||||||
|
@@ -178,7 +178,7 @@ export class PrivateKeyLocator extends AutoPrivateKeyLocator {
|
|||||||
if (/^id_[\w\d]+$/.test(file)) {
|
if (/^id_[\w\d]+$/.test(file)) {
|
||||||
const privateKeyContents = await fs.readFile(
|
const privateKeyContents = await fs.readFile(
|
||||||
path.join(keysPath, file),
|
path.join(keysPath, file),
|
||||||
{ encoding: null }
|
{ encoding: null },
|
||||||
)
|
)
|
||||||
results.push([file, privateKeyContents])
|
results.push([file, privateKeyContents])
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,7 @@ export class LocalProfileSettingsComponent implements ProfileSettingsComponent<L
|
|||||||
// TODO
|
// TODO
|
||||||
// defaultPath: shell.fsBase,
|
// defaultPath: shell.fsBase,
|
||||||
properties: ['openDirectory', 'showHiddenFiles'],
|
properties: ['openDirectory', 'showHiddenFiles'],
|
||||||
}
|
},
|
||||||
)).filePaths
|
)).filePaths
|
||||||
this.profile.options.cwd = paths[0]
|
this.profile.options.cwd = paths[0]
|
||||||
}
|
}
|
||||||
|
@@ -119,7 +119,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0
|
)).response === 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -132,5 +132,5 @@ export default class LocalTerminalModule { // eslint-disable-line @typescript-es
|
|||||||
}
|
}
|
||||||
|
|
||||||
export { TerminalTabComponent }
|
export { TerminalTabComponent }
|
||||||
export { TerminalService, ShellProvider }
|
export { TerminalService }
|
||||||
export * from './api'
|
export * from './api'
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import * as fs from 'mz/fs'
|
import * as fsSync from 'fs'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { Logger, LogService, ConfigService, ProfilesService, PartialProfile } from 'tabby-core'
|
import { Logger, LogService, ConfigService, ProfilesService, PartialProfile } from 'tabby-core'
|
||||||
import { TerminalTabComponent } from '../components/terminalTab.component'
|
import { TerminalTabComponent } from '../components/terminalTab.component'
|
||||||
@@ -39,7 +39,7 @@ export class TerminalService {
|
|||||||
|
|
||||||
cwd = cwd ?? fullProfile.options.cwd
|
cwd = cwd ?? fullProfile.options.cwd
|
||||||
|
|
||||||
if (cwd && !fs.existsSync(cwd)) {
|
if (cwd && !fsSync.existsSync(cwd)) {
|
||||||
console.warn('Ignoring non-existent CWD:', cwd)
|
console.warn('Ignoring non-existent CWD:', cwd)
|
||||||
cwd = null
|
cwd = null
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import * as psNode from 'ps-node'
|
import * as psNode from 'ps-node'
|
||||||
import * as fs from 'mz/fs'
|
import * as fs from 'mz/fs'
|
||||||
|
import * as fsSync from 'fs'
|
||||||
import { Injector } from '@angular/core'
|
import { Injector } from '@angular/core'
|
||||||
import { HostAppService, ConfigService, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild, Platform, BootstrapData, BOOTSTRAP_DATA, LogService } from 'tabby-core'
|
import { HostAppService, ConfigService, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild, Platform, BootstrapData, BOOTSTRAP_DATA, LogService } from 'tabby-core'
|
||||||
import { BaseSession } from 'tabby-terminal'
|
import { BaseSession } from 'tabby-terminal'
|
||||||
@@ -169,7 +170,7 @@ export class Session extends BaseSession {
|
|||||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||||
let cwd = options.cwd || process.env.HOME
|
let cwd = options.cwd || process.env.HOME
|
||||||
|
|
||||||
if (!fs.existsSync(cwd)) {
|
if (!fsSync.existsSync(cwd)) {
|
||||||
console.warn('Ignoring non-existent CWD:', cwd)
|
console.warn('Ignoring non-existent CWD:', cwd)
|
||||||
cwd = undefined
|
cwd = undefined
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,7 @@ export class WSLShellProvider extends ShellProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!lxss || !lxss.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) {
|
if (!lxss?.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) {
|
||||||
if (await fs.exists(bashPath)) {
|
if (await fs.exists(bashPath)) {
|
||||||
return [{
|
return [{
|
||||||
id: 'wsl',
|
id: 'wsl',
|
||||||
|
@@ -36,7 +36,7 @@ export class PluginsSettingsTabComponent {
|
|||||||
constructor (
|
constructor (
|
||||||
private config: ConfigService,
|
private config: ConfigService,
|
||||||
private platform: PlatformService,
|
private platform: PlatformService,
|
||||||
public pluginManager: PluginManagerService
|
public pluginManager: PluginManagerService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ export class PluginsSettingsTabComponent {
|
|||||||
return this.pluginManager.listAvailable(query).pipe(tap(() => {
|
return this.pluginManager.listAvailable(query).pipe(tap(() => {
|
||||||
this.availablePluginsReady = true
|
this.availablePluginsReady = true
|
||||||
}))
|
}))
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
this.availablePlugins$.pipe(first(), map((plugins: PluginInfo[]) => {
|
this.availablePlugins$.pipe(first(), map((plugins: PluginInfo[]) => {
|
||||||
plugins.sort((a, b) => a.name > b.name ? 1 : -1)
|
plugins.sort((a, b) => a.name > b.name ? 1 : -1)
|
||||||
@@ -69,7 +69,7 @@ export class PluginsSettingsTabComponent {
|
|||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
flatMap(query => {
|
flatMap(query => {
|
||||||
return this.pluginManager.listInstalled(query)
|
return this.pluginManager.listInstalled(query)
|
||||||
})
|
}),
|
||||||
).subscribe(plugin => {
|
).subscribe(plugin => {
|
||||||
this.installedPlugins$ = plugin
|
this.installedPlugins$ = plugin
|
||||||
})
|
})
|
||||||
|
@@ -51,7 +51,7 @@ export class PluginManagerService {
|
|||||||
|
|
||||||
_listAvailableInternal (namePrefix: string, keyword: string, query?: string): Observable<PluginInfo[]> {
|
_listAvailableInternal (namePrefix: string, keyword: string, query?: string): Observable<PluginInfo[]> {
|
||||||
return from(
|
return from(
|
||||||
axios.get(`https://registry.npmjs.com/-/v1/search?text=keywords%3A${keyword}%20${query}&size=250`)
|
axios.get(`https://registry.npmjs.com/-/v1/search?text=keywords%3A${keyword}%20${query}&size=250`),
|
||||||
).pipe(
|
).pipe(
|
||||||
map(response => response.data.objects
|
map(response => response.data.objects
|
||||||
.filter(item => !item.keywords?.includes('tabby-dummy-transition-plugin'))
|
.filter(item => !item.keywords?.includes('tabby-dummy-transition-plugin'))
|
||||||
@@ -61,9 +61,9 @@ export class PluginManagerService {
|
|||||||
description: item.package.description,
|
description: item.package.description,
|
||||||
version: item.package.version,
|
version: item.package.version,
|
||||||
homepage: item.package.links.homepage,
|
homepage: item.package.links.homepage,
|
||||||
author: (item.package.author || {}).name,
|
author: item.package.author?.name,
|
||||||
isOfficial: item.package.publisher.username === OFFICIAL_NPM_ACCOUNT,
|
isOfficial: item.package.publisher.username === OFFICIAL_NPM_ACCOUNT,
|
||||||
}))
|
})),
|
||||||
),
|
),
|
||||||
map(plugins => plugins.filter(x => x.packageName.startsWith(namePrefix))),
|
map(plugins => plugins.filter(x => x.packageName.startsWith(namePrefix))),
|
||||||
map(plugins => plugins.filter(x => !PLUGIN_BLACKLIST.includes(x.packageName))),
|
map(plugins => plugins.filter(x => !PLUGIN_BLACKLIST.includes(x.packageName))),
|
||||||
|
@@ -29,7 +29,7 @@ export class SerialProfileSettingsComponent implements ProfileSettingsComponent<
|
|||||||
map((q: string) => [
|
map((q: string) => [
|
||||||
null,
|
null,
|
||||||
...BAUD_RATES.filter(x => !q || x.toString().startsWith(q)),
|
...BAUD_RATES.filter(x => !q || x.toString().startsWith(q)),
|
||||||
])
|
]),
|
||||||
)
|
)
|
||||||
|
|
||||||
portsFormatter = port => {
|
portsFormatter = port => {
|
||||||
|
@@ -7,8 +7,8 @@ import { ConfigProxy, ConfigService, Profile, ProfileProvider, ProfileSettingsCo
|
|||||||
const iconsData = require('../../../tabby-core/src/icons.json')
|
const iconsData = require('../../../tabby-core/src/icons.json')
|
||||||
const iconsClassList = Object.keys(iconsData).map(
|
const iconsClassList = Object.keys(iconsData).map(
|
||||||
icon => iconsData[icon].map(
|
icon => iconsData[icon].map(
|
||||||
style => `fa${style[0]} fa-${icon}`
|
style => `fa${style[0]} fa-${icon}`,
|
||||||
)
|
),
|
||||||
).flat()
|
).flat()
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@@ -36,7 +36,7 @@ export class EditProfileModalComponent<P extends Profile> {
|
|||||||
this.groupNames = [...new Set(
|
this.groupNames = [...new Set(
|
||||||
(config.store.profiles as Profile[])
|
(config.store.profiles as Profile[])
|
||||||
.map(x => x.group)
|
.map(x => x.group)
|
||||||
.filter(x => !!x)
|
.filter(x => !!x),
|
||||||
)].sort() as string[]
|
)].sort() as string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,8 +46,8 @@ export class EditProfileModalComponent<P extends Profile> {
|
|||||||
map((q: string) =>
|
map((q: string) =>
|
||||||
TAB_COLORS
|
TAB_COLORS
|
||||||
.filter(x => !q || x.name.toLowerCase().startsWith(q.toLowerCase()))
|
.filter(x => !q || x.name.toLowerCase().startsWith(q.toLowerCase()))
|
||||||
.map(x => x.value)
|
.map(x => x.value),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
colorsFormatter = value => {
|
colorsFormatter = value => {
|
||||||
@@ -76,13 +76,13 @@ export class EditProfileModalComponent<P extends Profile> {
|
|||||||
text$.pipe(
|
text$.pipe(
|
||||||
debounceTime(200),
|
debounceTime(200),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
map(q => this.groupNames.filter(x => !q || x.toLowerCase().includes(q.toLowerCase())))
|
map(q => this.groupNames.filter(x => !q || x.toLowerCase().includes(q.toLowerCase()))),
|
||||||
)
|
)
|
||||||
|
|
||||||
iconSearch: OperatorFunction<string, string[]> = (text$: Observable<string>) =>
|
iconSearch: OperatorFunction<string, string[]> = (text$: Observable<string>) =>
|
||||||
text$.pipe(
|
text$.pipe(
|
||||||
debounceTime(200),
|
debounceTime(200),
|
||||||
map(term => iconsClassList.filter(v => v.toLowerCase().includes(term.toLowerCase())).slice(0, 10))
|
map(term => iconsClassList.filter(v => v.toLowerCase().includes(term.toLowerCase())).slice(0, 10)),
|
||||||
)
|
)
|
||||||
|
|
||||||
save () {
|
save () {
|
||||||
|
@@ -140,7 +140,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 1,
|
defaultId: 1,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0) {
|
)).response === 0) {
|
||||||
this.profilesService.providerForProfile(profile)?.deleteProfile(
|
this.profilesService.providerForProfile(profile)?.deleteProfile(
|
||||||
this.profilesService.getConfigProxyForProfile(profile))
|
this.profilesService.getConfigProxyForProfile(profile))
|
||||||
@@ -205,7 +205,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 1,
|
defaultId: 1,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0) {
|
)).response === 0) {
|
||||||
if ((await this.platform.showMessageBox(
|
if ((await this.platform.showMessageBox(
|
||||||
{
|
{
|
||||||
@@ -217,7 +217,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 0,
|
cancelId: 0,
|
||||||
}
|
},
|
||||||
)).response === 0) {
|
)).response === 0) {
|
||||||
for (const profile of this.profiles.filter(x => x.group === group.name)) {
|
for (const profile of this.profiles.filter(x => x.group === group.name)) {
|
||||||
delete profile.group
|
delete profile.group
|
||||||
|
@@ -18,8 +18,8 @@ export class SettingsTabBodyComponent {
|
|||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
this.component = this.placeholder.createComponent(
|
this.component = this.placeholder.createComponent(
|
||||||
this.componentFactoryResolver.resolveComponentFactory(
|
this.componentFactoryResolver.resolveComponentFactory(
|
||||||
this.provider.getComponentType()
|
this.provider.getComponentType(),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,7 @@ export class VaultSettingsTabComponent extends BaseComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 1,
|
defaultId: 1,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0) {
|
)).response === 0) {
|
||||||
await this.vault.setEnabled(false)
|
await this.vault.setEnabled(false)
|
||||||
}
|
}
|
||||||
|
@@ -98,7 +98,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
|
|
||||||
const jumpSession = await this.setupOneSession(
|
const jumpSession = await this.setupOneSession(
|
||||||
this.injector,
|
this.injector,
|
||||||
this.profilesService.getConfigProxyForProfile(jumpConnection)
|
this.profilesService.getConfigProxyForProfile(jumpConnection),
|
||||||
)
|
)
|
||||||
|
|
||||||
jumpSession.ref()
|
jumpSession.ref()
|
||||||
@@ -118,7 +118,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
resolve(stream)
|
resolve(stream)
|
||||||
}
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0
|
)).response === 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,4 +75,4 @@ export default class SSHModule { }
|
|||||||
|
|
||||||
export * from './api'
|
export * from './api'
|
||||||
export { SFTPFile, SFTPSession } from './session/sftp'
|
export { SFTPFile, SFTPSession } from './session/sftp'
|
||||||
export { SFTPPanelComponent, SFTPContextMenuItemProvider }
|
export { SFTPPanelComponent }
|
||||||
|
@@ -554,7 +554,7 @@ export class SSHSession {
|
|||||||
socket.on('close', () => {
|
socket.on('close', () => {
|
||||||
stream.close()
|
stream.close()
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.emitServiceMessage(colors.bgGreen.black(' -> ') + ` Forwarded ${fw}`)
|
this.emitServiceMessage(colors.bgGreen.black(' -> ') + ` Forwarded ${fw}`)
|
||||||
|
@@ -126,7 +126,7 @@ export class TelnetTabComponent extends BaseTerminalTabComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0
|
)).response === 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -483,7 +483,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
buttons,
|
buttons,
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response
|
)).response
|
||||||
if (result === 1) {
|
if (result === 1) {
|
||||||
return
|
return
|
||||||
|
@@ -79,7 +79,7 @@ export class SessionMiddlewareStack extends SessionMiddleware {
|
|||||||
for (let i = 0; i < this.stack.length - 1; i++) {
|
for (let i = 0; i < this.stack.length - 1; i++) {
|
||||||
this.subs.subscribe(
|
this.subs.subscribe(
|
||||||
this.stack[i].outputToTerminal$,
|
this.stack[i].outputToTerminal$,
|
||||||
x => this.stack[i + 1].feedFromSession(x)
|
x => this.stack[i + 1].feedFromSession(x),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
this.subs.subscribe(
|
this.subs.subscribe(
|
||||||
@@ -90,7 +90,7 @@ export class SessionMiddlewareStack extends SessionMiddleware {
|
|||||||
for (let i = this.stack.length - 2; i >= 0; i--) {
|
for (let i = this.stack.length - 2; i >= 0; i--) {
|
||||||
this.subs.subscribe(
|
this.subs.subscribe(
|
||||||
this.stack[i + 1].outputToSession$,
|
this.stack[i + 1].outputToSession$,
|
||||||
x => this.stack[i].feedFromTerminal(x)
|
x => this.stack[i].feedFromTerminal(x),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
this.subs.subscribe(
|
this.subs.subscribe(
|
||||||
|
@@ -91,7 +91,7 @@ export class ColorSchemeSettingsTabComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 1,
|
defaultId: 1,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0) {
|
)).response === 0) {
|
||||||
this.customColorSchemes = this.customColorSchemes.filter(x => x.name !== scheme.name)
|
this.customColorSchemes = this.customColorSchemes.filter(x => x.name !== scheme.name)
|
||||||
this.config.store.terminal.customColorSchemes = this.customColorSchemes
|
this.config.store.terminal.customColorSchemes = this.customColorSchemes
|
||||||
|
@@ -34,7 +34,7 @@ export class LoginScriptsSettingsComponent {
|
|||||||
],
|
],
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
}
|
},
|
||||||
)).response === 0) {
|
)).response === 0) {
|
||||||
this.scripts = this.scripts.filter(x => x !== script)
|
this.scripts = this.scripts.filter(x => x !== script)
|
||||||
}
|
}
|
||||||
|
@@ -451,13 +451,13 @@ export class XTermFrontend extends Frontend {
|
|||||||
|
|
||||||
findNext (term: string, searchOptions?: SearchOptions): SearchState {
|
findNext (term: string, searchOptions?: SearchOptions): SearchState {
|
||||||
return this.wrapSearchResult(
|
return this.wrapSearchResult(
|
||||||
this.search.findNext(term, this.getSearchOptions(searchOptions))
|
this.search.findNext(term, this.getSearchOptions(searchOptions)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
findPrevious (term: string, searchOptions?: SearchOptions): SearchState {
|
findPrevious (term: string, searchOptions?: SearchOptions): SearchState {
|
||||||
return this.wrapSearchResult(
|
return this.wrapSearchResult(
|
||||||
this.search.findPrevious(term, this.getSearchOptions(searchOptions))
|
this.search.findPrevious(term, this.getSearchOptions(searchOptions)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ export class LoginScriptProcessor extends SessionMiddleware {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private logger: Logger,
|
private logger: Logger,
|
||||||
options: LoginScriptsOptions
|
options: LoginScriptsOptions,
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
this.remainingScripts = deepClone(options.scripts ?? [])
|
this.remainingScripts = deepClone(options.scripts ?? [])
|
||||||
|
Reference in New Issue
Block a user