Implement changing between terminal menu items

This commit is contained in:
Kristóf Tóth
2018-05-25 15:45:56 +02:00
parent 32dab3b967
commit 469c5ced7b
2 changed files with 14 additions and 5 deletions

View File

@ -20,7 +20,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
hide_messages: boolean = config.dashboard.hide_messages;
iframeUrl: string = config.dashboard.iframeUrl;
@ViewChild('webiframe') webiframe: ElementRef;
terminalOrConsole = config.dashboard.terminalOrConsole;
selectedTerminalMenuItem = config.dashboard.terminalOrConsole;
command_handlers = {'layout': this.layoutHandler.bind(this),
'reload_frontend': this.reloadFrontendHandlder.bind(this)};
@ -85,4 +85,11 @@ export class DashboardComponent implements OnInit, OnDestroy {
this.webiframe.nativeElement.contentWindow.location.reload(true);
});
}
selectTerminalMenuItem(item: string) {
if (!item.match('(terminal|console)')) {
return;
}
this.selectedTerminalMenuItem = item;
}
}