From bafb88012dbd70785fe97d4d38d4646fbd38f6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 20 Apr 2018 14:50:43 +0200 Subject: [PATCH] Implement reloading of frontend from API --- src/app/dashboard/dashboard.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 0533b46..716d6a9 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -16,7 +16,8 @@ export class DashboardComponent implements OnInit, OnDestroy { deploymentNotificationSubscription: Subscription; layout: string = config.dashboard.currentLayout; hide_messages: boolean = config.dashboard.hide_messages; - command_handlers = {'layout': this.layoutHandler.bind(this)}; + command_handlers = {'layout': this.layoutHandler.bind(this), + 'reload_frontend': this.reloadFrontendHandlder.bind(this)}; constructor(private deploymentNotificationService: DeploymentNotificationService, private webSocketService: WebSocketService, @@ -44,6 +45,10 @@ export class DashboardComponent implements OnInit, OnDestroy { } } + reloadFrontendHandlder(data: LayoutCommand) { + setTimeout(() => window.location.reload(), 2000); + } + setLayout(layout: string) { this.layout = layout; // We need to trigger a 'resize' event manually, otherwise ace editor stays collapsed