Make type hierarchy from messages

This commit is contained in:
Kristóf Tóth
2018-05-31 12:02:53 +02:00
parent e510fb58f6
commit 887a81ab8e
12 changed files with 51 additions and 37 deletions

View File

@ -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);
}