mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-15 23:51:57 +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;
|
deploymentNotificationSubscription: Subscription;
|
||||||
layout: string = config.dashboard.currentLayout;
|
layout: string = config.dashboard.currentLayout;
|
||||||
hide_messages: boolean = config.dashboard.hide_messages;
|
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,
|
constructor(private deploymentNotificationService: DeploymentNotificationService,
|
||||||
private webSocketService: WebSocketService,
|
private webSocketService: WebSocketService,
|
||||||
@ -44,6 +45,10 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reloadFrontendHandlder(data: LayoutCommand) {
|
||||||
|
setTimeout(() => window.location.reload(), 2000);
|
||||||
|
}
|
||||||
|
|
||||||
setLayout(layout: string) {
|
setLayout(layout: string) {
|
||||||
this.layout = layout;
|
this.layout = layout;
|
||||||
// We need to trigger a 'resize' event manually, otherwise ace editor stays collapsed
|
// We need to trigger a 'resize' event manually, otherwise ace editor stays collapsed
|
||||||
|
Loading…
Reference in New Issue
Block a user