mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-15 18:31:56 +00:00
Implement reloading of frontend from API
This commit is contained in:
parent
eabd7d6c75
commit
bafb88012d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user