mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-07-02 05:16:23 +00:00
Refactor console message types and API
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { WebSocketService } from '../services/websocket.service';
|
||||
import { ConsoleCommand } from '../message.types/console.command';
|
||||
import { ConsoleContentCommand, RewriteContentCommand, ShowLiveLogsCommand } from '../message.types/console.commands';
|
||||
import { config } from '../config';
|
||||
import { ProcessLogService } from '../services/processlog.service';
|
||||
import { LogMessage } from '../message.types/log.message';
|
||||
@ -36,11 +36,11 @@ export class ConsoleComponent implements OnInit {
|
||||
this.processLogService.newLogs.subscribe((data) => this.newLogsHandler(data));
|
||||
}
|
||||
|
||||
writeHandler(data: ConsoleCommand) {
|
||||
writeHandler(data: ConsoleContentCommand) {
|
||||
this.setContent(data.content);
|
||||
}
|
||||
|
||||
readHandler(data: CommandMessage) {
|
||||
readHandler(data: ConsoleContentCommand) {
|
||||
this.sendContent(this.console_content);
|
||||
}
|
||||
|
||||
@ -53,12 +53,12 @@ export class ConsoleComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
showLiveLogsHandler(data: ConsoleCommand) {
|
||||
this.processLogService.showLiveLogs = data.showLiveLogs;
|
||||
showLiveLogsHandler(data: ShowLiveLogsCommand) {
|
||||
this.processLogService.showLiveLogs = data.value;
|
||||
}
|
||||
|
||||
rewriteContentWithProcessLogsOnDeployHandler(data: ConsoleCommand) {
|
||||
this.rewriteContentWithProcessLogsOnDeploy = data.rewriteContentWithProcessLogsOnDeploy;
|
||||
rewriteContentWithProcessLogsOnDeployHandler(data: RewriteContentCommand) {
|
||||
this.rewriteContentWithProcessLogsOnDeploy = data.value;
|
||||
}
|
||||
|
||||
setContent(content: string) {
|
||||
|
Reference in New Issue
Block a user