mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-11 14:41:13 +08:00
updated web demo for new profiles
This commit is contained in:
parent
dbe7b8cf56
commit
c2657568a6
@ -21,7 +21,7 @@ export class DemoTerminalTabComponent extends BaseTerminalTabComponent {
|
|||||||
|
|
||||||
ngOnInit (): void {
|
ngOnInit (): void {
|
||||||
this.logger = this.log.create('terminalTab')
|
this.logger = this.log.create('terminalTab')
|
||||||
this.session = new Session(this.logger)
|
this.session = new Session(this.injector, this.logger)
|
||||||
super.ngOnInit()
|
super.ngOnInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||||
|
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'
|
||||||
|
|
||||||
const currentScript: any = document.currentScript
|
const currentScript: any = document.currentScript
|
||||||
|
|
||||||
export class Session extends BaseSession {
|
export class Session extends BaseSession {
|
||||||
private dataPath = window['tabbyWebDemoDataPath'] ?? currentScript.src + '../../../data'
|
private dataPath = window['tabbyWebDemoDataPath'] ?? currentScript.src + '../../../data'
|
||||||
private vm: any
|
private vm: any
|
||||||
|
private zone: NgZone
|
||||||
static v86Loaded = false
|
static v86Loaded = false
|
||||||
|
|
||||||
|
constructor (
|
||||||
|
injector: Injector,
|
||||||
|
logger: Logger,
|
||||||
|
) {
|
||||||
|
super(logger)
|
||||||
|
this.zone = injector.get(NgZone)
|
||||||
|
}
|
||||||
|
|
||||||
async start (): Promise<void> {
|
async start (): Promise<void> {
|
||||||
this.open = true
|
this.open = true
|
||||||
this.emitMessage('Hey\r\n')
|
this.emitMessage('Hey\r\n')
|
||||||
@ -25,23 +36,25 @@ export class Session extends BaseSession {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.vm = new window['V86Starter']({
|
this.zone.runOutsideAngular(() => {
|
||||||
bios: {
|
this.vm = new window['V86Starter']({
|
||||||
url: `${this.dataPath}/bios.bin`,
|
bios: {
|
||||||
},
|
url: `${this.dataPath}/bios.bin`,
|
||||||
vga_bios: {
|
},
|
||||||
url: `${this.dataPath}/vgabios.bin`,
|
vga_bios: {
|
||||||
},
|
url: `${this.dataPath}/vgabios.bin`,
|
||||||
wasm_path: `${this.dataPath}/v86.wasm`,
|
},
|
||||||
cdrom: {
|
wasm_path: `${this.dataPath}/v86.wasm`,
|
||||||
url: `${this.dataPath}/linux.iso`,
|
cdrom: {
|
||||||
},
|
url: `${this.dataPath}/linux.iso`,
|
||||||
initial_state: {
|
},
|
||||||
url: `${this.dataPath}/v86state.bin`,
|
initial_state: {
|
||||||
},
|
url: `${this.dataPath}/v86state.bin`,
|
||||||
autostart: true,
|
},
|
||||||
disable_keyboard: true,
|
autostart: true,
|
||||||
disable_speaker: true,
|
disable_keyboard: true,
|
||||||
|
disable_speaker: true,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.vm.add_listener('emulator-ready', () => {
|
this.vm.add_listener('emulator-ready', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user