mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:11:32 +00:00
Refactor dashboard API hide_messages to a separate command
This commit is contained in:
parent
6403af00dd
commit
6ca78f12fd
@ -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"
|
||||
|
@ -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) {
|
||||
|
@ -3,6 +3,6 @@
|
||||
|
||||
export class LayoutCommand {
|
||||
command: string;
|
||||
layout: string;
|
||||
layout?: string;
|
||||
hide_messages?: boolean;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user