mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-06-28 17:55:13 +00:00
Make type hierarchy from messages
This commit is contained in:
@ -9,6 +9,7 @@ import { LayoutCommand } from '../message.types/layout.command';
|
||||
import { config } from '../config';
|
||||
import { ProcessLogService } from '../services/processlog.service';
|
||||
import { LogMessage } from '../message.types/log.message';
|
||||
import { CommandMessage } from '../message.types/command.message';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
@ -42,7 +43,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
initCommandHandling() {
|
||||
this.webSocketService.observeKey<LayoutCommand>('dashboard').subscribe((event) => {
|
||||
this.webSocketService.observeKey<CommandMessage>('dashboard').subscribe((event) => {
|
||||
this.command_handlers[event.data.command](event.data);
|
||||
this.changeDetectorRef.detectChanges();
|
||||
});
|
||||
@ -85,7 +86,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
this.selectTerminalMenuItem(data.terminal_menu_item);
|
||||
}
|
||||
|
||||
reloadFrontendHandlder(data: LayoutCommand) {
|
||||
reloadFrontendHandlder(data: CommandMessage) {
|
||||
setTimeout(() => window.location.reload(), 2000);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user