mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-06-28 17:45:11 +00:00
Implement ProcessLogService and hook it up to existing log features
This commit is contained in:
@ -7,7 +7,7 @@ import { Subscription } from 'rxjs';
|
||||
import { WebSocketService } from '../services/websocket.service';
|
||||
import { LayoutCommand } from './layout-command';
|
||||
import { config } from '../config';
|
||||
import { ConsoleComponent } from '../console/console.component';
|
||||
import { ProcessLogService } from '../services/processlog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
@ -21,7 +21,6 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
hide_messages: boolean = config.dashboard.hide_messages;
|
||||
iframeUrl: string = config.dashboard.iframeUrl;
|
||||
@ViewChild('webiframe') webiframe: ElementRef;
|
||||
@ViewChild(ConsoleComponent) childConsole: ConsoleComponent;
|
||||
selectedTerminalMenuItem = config.dashboard.terminalOrConsole;
|
||||
|
||||
command_handlers = {'layout': this.layoutHandler.bind(this),
|
||||
@ -31,7 +30,8 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(private deploymentNotificationService: DeploymentNotificationService,
|
||||
private webSocketService: WebSocketService,
|
||||
private changeDetectorRef: ChangeDetectorRef) {}
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
private processLogService: ProcessLogService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.webSocketService.connect();
|
||||
@ -103,9 +103,11 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
setConsoleContent(logs: any) {
|
||||
this.childConsole.newLogHandler(logs);
|
||||
if (config.ide.showConsoleOnDeploy) {
|
||||
this.selectTerminalMenuItem('console');
|
||||
if (!config.console.showLiveLogs) {
|
||||
this.processLogService.newLog.next(logs);
|
||||
if (config.ide.showConsoleOnDeploy) {
|
||||
this.selectTerminalMenuItem('console');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user