This commit is contained in:
Eugene Pankov 2021-07-11 16:24:04 +02:00
parent 7db3335938
commit d8a8d41614
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
3 changed files with 11 additions and 8 deletions

View File

@ -31,6 +31,7 @@ import { DemoProfilesService } from 'profiles'
DemoTerminalTabComponent,
],
})
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export default class DemoTerminalModule {
constructor (
app: AppService,
@ -39,4 +40,4 @@ export default class DemoTerminalModule {
app.openNewTab({ type: DemoTerminalTabComponent })
})
}
} // eslint-disable-line @typescript-eslint/no-extraneous-class
}

View File

@ -1,9 +1,11 @@
/* eslint-disable @typescript-eslint/no-empty-function */
import * as path from 'path'
import { BaseSession } from 'tabby-terminal'
const currentScript: any = document.currentScript
export class Session extends BaseSession {
private dataPath = window['tabbyWebDemoDataPath'] ?? (currentScript.src + '../../../data')
private dataPath = window['tabbyWebDemoDataPath'] ?? currentScript.src + '../../../data'
private vm: any
static v86Loaded = false
@ -49,7 +51,7 @@ export class Session extends BaseSession {
}, 2000)
})
this.vm.add_listener('download-progress', (e) => {
this.emitMessage(`\rDownloading ${e.file_name}: ${e.loaded / 1024}/${e.total / 1024} kB `)
this.emitMessage(`\rDownloading ${path.basename(e.file_name)}: ${e.loaded / 1024}/${e.total / 1024} kB `)
})
this.vm.add_listener('download-error', (e) => {
this.emitMessage(`\r\nDownload error: ${e}\r\n`)
@ -60,8 +62,7 @@ export class Session extends BaseSession {
})
}
resize (_columns: number, _rows: number): void {
}
resize (_columns: number, _rows: number): void { }
write (data: Buffer): void {
this.vm.serial0_send(data.toString())
@ -74,13 +75,13 @@ export class Session extends BaseSession {
this.emitOutput(Buffer.from(msg))
}
async gracefullyKillProcess(): Promise<void> { }
async gracefullyKillProcess (): Promise<void> { }
supportsWorkingDirectory(): boolean {
supportsWorkingDirectory (): boolean {
return false
}
getWorkingDirectory(): Promise<string | null> {
getWorkingDirectory (): Promise<string | null> {
return null
}
}

View File

@ -33,6 +33,7 @@ module.exports = {
externals: [
'fs',
'ngx-toastr',
'path',
/^rxjs/,
/^@angular/,
/^@ng-bootstrap/,