Refactor dashboard API hide_messages to a separate command

This commit is contained in:
Kristóf Tóth
2018-05-27 16:45:52 +02:00
parent 6403af00dd
commit 6ca78f12fd
3 changed files with 10 additions and 6 deletions

View File

@ -23,6 +23,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
selectedTerminalMenuItem = config.dashboard.terminalOrConsole;
command_handlers = {'layout': this.layoutHandler.bind(this),
'hide_messages': this.hideMessagesHandler.bind(this),
'reload_frontend': this.reloadFrontendHandlder.bind(this)};
constructor(private deploymentNotificationService: DeploymentNotificationService,
@ -58,9 +59,10 @@ export class DashboardComponent implements OnInit, OnDestroy {
} else {
console.log('Invalid ide layout "' + data.layout + '" received!');
}
if (data.hide_messages !== undefined) {
this.hide_messages = data.hide_messages;
}
}
hideMessagesHandler(data: LayoutCommand) {
this.hide_messages = data.hide_messages;
}
reloadFrontendHandlder(data: LayoutCommand) {