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

@ -4,9 +4,11 @@
<div [attr.class]="layout">
<div class="tfw-grid-main-components">
<div class="tfw-header"><app-header></app-header></div>
<div [ngClass]="{ 'hide-attribute': hide_messages }" class="tfw-messages"><app-messages></app-messages></div>
<div [ngClass]="{'hide-attribute': hide_messages}" class="tfw-messages">
<app-messages></app-messages>
</div>
<div class="tfw-web tao-grid-top-left"
[ngClass]="{ 'deploy-blur': deploying }">
[ngClass]="{'deploy-blur': deploying}">
<app-web *ngIf="!iframeUrl"></app-web>
<div *ngIf="iframeUrl" class="iframe-container">
<iframe class="iframe"

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) {

View File

@ -3,6 +3,6 @@
export class LayoutCommand {
command: string;
layout: string;
layout?: string;
hide_messages?: boolean;
}