Implement changing between terminal menu items from API

This commit is contained in:
Kristóf Tóth 2018-05-27 16:57:29 +02:00
parent 6ca78f12fd
commit 3456595c5a
2 changed files with 9 additions and 3 deletions

View File

@ -24,6 +24,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
command_handlers = {'layout': this.layoutHandler.bind(this),
'hide_messages': this.hideMessagesHandler.bind(this),
'terminal_menu': this.terminalMenuSelectHandler.bind(this),
'reload_frontend': this.reloadFrontendHandlder.bind(this)};
constructor(private deploymentNotificationService: DeploymentNotificationService,
@ -65,6 +66,10 @@ export class DashboardComponent implements OnInit, OnDestroy {
this.hide_messages = data.hide_messages;
}
terminalMenuSelectHandler(data: LayoutCommand) {
this.selectTerminalMenuItem(data.terminal_menu_item);
}
reloadFrontendHandlder(data: LayoutCommand) {
setTimeout(() => window.location.reload(), 2000);
}

View File

@ -2,7 +2,8 @@
// All Rights Reserved. See LICENSE file for details.
export class LayoutCommand {
command: string;
layout?: string;
hide_messages?: boolean;
command: string;
layout?: string;
hide_messages?: boolean;
terminal_menu_item?: string;
}