Fix for console widget

This commit is contained in:
piotrpekala7 2020-04-30 16:33:20 +02:00
parent a75de3b179
commit 9e2bc25c01
3 changed files with 6 additions and 1 deletions
src/app
components/project-map
services

@ -3,6 +3,7 @@ import { Node } from '../../../../../cartography/models/node';
import { Server } from '../../../../../models/server';
import { NodeConsoleService } from '../../../../../services/nodeConsole.service';
import { ToasterService } from '../../../../../services/toaster.service';
import { MapSettingsService } from '../../../../../services/mapsettings.service';
@Component({
@ -15,7 +16,8 @@ export class HttpConsoleActionComponent implements OnInit {
constructor(
private consoleService: NodeConsoleService,
private toasterService: ToasterService
private toasterService: ToasterService,
private mapSettingsService: MapSettingsService
) { }
ngOnInit() {}
@ -23,6 +25,7 @@ export class HttpConsoleActionComponent implements OnInit {
openConsole() {
this.nodes.forEach(n => {
if (n.status === 'started') {
this.mapSettingsService.logConsoleSubject.next(true);
this.consoleService.openConsoleForNode(n);
} else {
this.toasterService.error('To open console please start the node');

@ -163,6 +163,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
this.settings = this.settingsService.getAll();
this.isTopologySummaryVisible = this.mapSettingsService.isTopologySummaryVisible;
this.isConsoleVisible = this.mapSettingsService.isLogConsoleVisible;
this.mapSettingsService.logConsoleSubject.subscribe(value => this.isConsoleVisible = value);
this.progressService.activate();
const routeSub = this.route.paramMap.subscribe((paramMap: ParamMap) => {

@ -8,6 +8,7 @@ export class MapSettingsService {
public isLogConsoleVisible: boolean = false;
public isLayerNumberVisible: boolean = false;
public interfaceLabels: Map<string, boolean> = new Map<string, boolean>();
public logConsoleSubject = new Subject<boolean>();
public mapRenderedEmitter = new EventEmitter<boolean>();
constructor() {