Console in new tab for many nodes at one click

This commit is contained in:
piotrpekala7 2021-05-11 01:35:07 +02:00
parent 1f972d3261
commit abdd739f06
5 changed files with 3 additions and 12 deletions

View File

@ -23,7 +23,7 @@ export class HttpConsoleNewTabActionComponent implements OnInit {
let urlString = `/static/web-ui/${url[1]}/${url[2]}/${url[3]}/${url[4]}/nodes/${n.node_id}`; let urlString = `/static/web-ui/${url[1]}/${url[2]}/${url[3]}/${url[4]}/nodes/${n.node_id}`;
window.open(urlString); window.open(urlString);
} else { } else {
this.toasterService.error('To open console please start the node'); this.toasterService.error('To open console please start the node ' + n.name);
} }
}); });
} }

View File

@ -13,7 +13,7 @@
[nodes]="nodes" [nodes]="nodes"
></app-http-console-action> ></app-http-console-action>
<app-http-console-new-tab-action <app-http-console-new-tab-action
*ngIf="!projectService.isReadOnly(project) && nodes.length === 1" *ngIf="!projectService.isReadOnly(project) && nodes.length > 0"
[server]="server" [server]="server"
[nodes]="nodes" [nodes]="nodes"
></app-http-console-new-tab-action> ></app-http-console-new-tab-action>

View File

@ -64,7 +64,6 @@
<div class="menu-button-group"> <div class="menu-button-group">
<app-nodes-menu [server]="server" [project]="project"></app-nodes-menu> <app-nodes-menu [server]="server" [project]="project"></app-nodes-menu>
<app-context-menu [project]="project" [server]="server"></app-context-menu> <app-context-menu [project]="project" [server]="server"></app-context-menu>
<app-context-console-menu [project]="project" [server]="server"></app-context-console-menu>
</div> </div>
</div> </div>
<div> <div>

View File

@ -74,7 +74,6 @@ import { ImportProjectDialogComponent } from '../projects/import-project-dialog/
import { NavigationDialogComponent } from '../projects/navigation-dialog/navigation-dialog.component'; import { NavigationDialogComponent } from '../projects/navigation-dialog/navigation-dialog.component';
import { SaveProjectDialogComponent } from '../projects/save-project-dialog/save-project-dialog.component'; import { SaveProjectDialogComponent } from '../projects/save-project-dialog/save-project-dialog.component';
import { NodeAddedEvent } from '../template/template-list-dialog/template-list-dialog.component'; import { NodeAddedEvent } from '../template/template-list-dialog/template-list-dialog.component';
import { ContextConsoleMenuComponent } from './context-console-menu/context-console-menu.component';
import { ContextMenuComponent } from './context-menu/context-menu.component'; import { ContextMenuComponent } from './context-menu/context-menu.component';
import { NodeCreatedLabelStylesFixer } from './helpers/node-created-label-styles-fixer'; import { NodeCreatedLabelStylesFixer } from './helpers/node-created-label-styles-fixer';
import { NewTemplateDialogComponent } from './new-template-dialog/new-template-dialog.component'; import { NewTemplateDialogComponent } from './new-template-dialog/new-template-dialog.component';
@ -120,7 +119,6 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
public isLightThemeEnabled: boolean = false; public isLightThemeEnabled: boolean = false;
@ViewChild(ContextMenuComponent) contextMenu: ContextMenuComponent; @ViewChild(ContextMenuComponent) contextMenu: ContextMenuComponent;
@ViewChild(ContextConsoleMenuComponent) consoleContextMenu: ContextConsoleMenuComponent;
@ViewChild(D3MapComponent) mapChild: D3MapComponent; @ViewChild(D3MapComponent) mapChild: D3MapComponent;
@ViewChild(ProjectMapMenuComponent) projectMapMenuComponent: ProjectMapMenuComponent; @ViewChild(ProjectMapMenuComponent) projectMapMenuComponent: ProjectMapMenuComponent;
@ -513,11 +511,6 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
this.contextMenu.openMenuForListOfElements(drawings, nodes, labels, links, event.pageY, event.pageX); this.contextMenu.openMenuForListOfElements(drawings, nodes, labels, links, event.pageY, event.pageX);
}); });
const onContextConsoleMenu = this.nodeWidget.onContextConsoleMenu.subscribe((eventNode: NodeContextMenu) => {
const node = this.mapNodeToNode.convert(eventNode.node);
this.consoleContextMenu.openMenu(node, eventNode.event.pageY, eventNode.event.pageX);
});
this.projectMapSubscription.add(onLinkContextMenu); this.projectMapSubscription.add(onLinkContextMenu);
this.projectMapSubscription.add(onEthernetLinkContextMenu); this.projectMapSubscription.add(onEthernetLinkContextMenu);
this.projectMapSubscription.add(onSerialLinkContextMenu); this.projectMapSubscription.add(onSerialLinkContextMenu);
@ -526,7 +519,6 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
this.projectMapSubscription.add(onContextMenu); this.projectMapSubscription.add(onContextMenu);
this.projectMapSubscription.add(onLabelContextMenu); this.projectMapSubscription.add(onLabelContextMenu);
this.projectMapSubscription.add(onInterfaceLabelContextMenu); this.projectMapSubscription.add(onInterfaceLabelContextMenu);
this.projectMapSubscription.add(onContextConsoleMenu);
this.mapChangeDetectorRef.detectChanges(); this.mapChangeDetectorRef.detectChanges();
} }

View File

@ -35,7 +35,7 @@
</script> </script>
</head> </head>
<!-- <body class="mat-app-background" oncontextmenu="return false;"> --> <!-- <body class="mat-app-background" oncontextmenu="return false;"> -->
<body class="mat-app-background"> <body class="mat-app-background" oncontextmenu="return false;">
<app-root></app-root> <app-root></app-root>
<!-- Global site tag (gtag.js) - Google Analytics --> <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5D6FZL9923"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-5D6FZL9923"></script>