mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-27 14:29:45 +00:00
Fix for console widget
This commit is contained in:
parent
a75de3b179
commit
9e2bc25c01
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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user