Implement triggering first FSM step defined in config

This commit is contained in:
Kristóf Tóth 2018-05-30 15:31:47 +02:00
parent 3b94ed0db6
commit b8161194d7
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@ export const config = {
documentTitle: 'Avatao Tutorials',
dashboard: {
route: 'dashboard',
triggerFirstFSMStep: 'step_1',
terminalOrConsole: 'terminal',
currentLayout: 'terminal-ide-web',
enabledLayouts: [

View File

@ -38,6 +38,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
this.webSocketService.connect();
this.initCommandHandling();
this.initDeploymentNotifications();
this.triggerFirstFSMStepIfNeeded();
}
initCommandHandling() {
@ -57,6 +58,17 @@ export class DashboardComponent implements OnInit, OnDestroy {
});
}
triggerFirstFSMStepIfNeeded() {
if (config.dashboard.triggerFirstFSMStep) {
setTimeout(() => {
this.webSocketService.sendJSON({
'key': '',
'trigger': config.dashboard.triggerFirstFSMStep
});
});
}
}
layoutHandler(data: LayoutCommand) {
if (config.dashboard.enabledLayouts.includes(data.layout)) {
this.setLayout(data.layout);