mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-08 12:20:14 +00:00
Update web-console.component.ts
This commit is contained in:
parent
a341d7c2ec
commit
2c3387c960
@ -35,26 +35,23 @@ export class WebConsoleComponent implements OnInit, AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
setTimeout(() => {
|
this.term.open(this.terminal.nativeElement);
|
||||||
this.term.open(this.terminal.nativeElement);
|
const socket = new WebSocket(this.getUrl());
|
||||||
const socket = new WebSocket(this.getUrl());
|
|
||||||
|
|
||||||
socket.onerror = ((event) => {
|
socket.onerror = ((event) => {
|
||||||
this.term.write('Connection lost');
|
this.term.write('Connection lost');
|
||||||
});
|
});
|
||||||
socket.onclose = ((event) => {
|
socket.onclose = ((event) => {
|
||||||
this.consoleService.closeConsoleForNode(this.node);
|
this.consoleService.closeConsoleForNode(this.node);
|
||||||
});
|
});
|
||||||
|
|
||||||
const attachAddon = new AttachAddon(socket);
|
const attachAddon = new AttachAddon(socket);
|
||||||
this.term.loadAddon(attachAddon);
|
this.term.loadAddon(attachAddon);
|
||||||
this.term.setOption('cursorBlink', true);
|
this.term.setOption('cursorBlink', true);
|
||||||
|
|
||||||
this.term.loadAddon(this.fitAddon);
|
this.term.loadAddon(this.fitAddon);
|
||||||
this.fitAddon.activate(this.term);
|
this.fitAddon.activate(this.term);
|
||||||
|
this.term.focus();
|
||||||
this.term.focus();
|
|
||||||
}, 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getUrl() {
|
getUrl() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user