mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-23 00:49:01 +00:00
Editing labels added
This commit is contained in:
@ -46,6 +46,7 @@ import { LinkWidget } from '../../cartography/widgets/link';
|
||||
import { NodeCreatedLabelStylesFixer } from './helpers/node-created-label-styles-fixer';
|
||||
import { InterfaceLabelWidget } from '../../cartography/widgets/interface-label';
|
||||
import { LabelWidget } from '../../cartography/widgets/label';
|
||||
import { MapLinkNodeToLinkNodeConverter } from '../../cartography/converters/map/map-link-node-to-link-node-converter';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -106,6 +107,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
private mapDrawingToDrawing: MapDrawingToDrawingConverter,
|
||||
private mapLabelToLabel: MapLabelToLabelConverter,
|
||||
private mapLinkToLink: MapLinkToLinkConverter,
|
||||
private mapLinkNodeToLinkNode: MapLinkNodeToLinkNodeConverter,
|
||||
private nodesDataSource: NodesDataSource,
|
||||
private linksDataSource: LinksDataSource,
|
||||
private drawingsDataSource: DrawingsDataSource,
|
||||
@ -244,13 +246,14 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
|
||||
const onLabelContextMenu = this.labelWidget.onContextMenu.subscribe((eventLabel: LabelContextMenu) => {
|
||||
const label = this.mapLabelToLabel.convert(eventLabel.label);
|
||||
this.contextMenu.openMenuForLabel(label, eventLabel.event.pageY, eventLabel.event.pageX);
|
||||
const node = this.nodes.find(n => n.node_id === eventLabel.label.nodeId);
|
||||
this.contextMenu.openMenuForLabel(label, node, eventLabel.event.pageY, eventLabel.event.pageX);
|
||||
});
|
||||
|
||||
const onInterfaceLabelContextMenu = this.interfaceLabelWidget.onContextMenu.subscribe((eventInterfaceLabel: InterfaceLabelContextMenu) => {
|
||||
console.log("!!!!!!!!!! interface label");
|
||||
console.log(eventInterfaceLabel);
|
||||
//const interfaceLabel = this.mapLinkToLink.convert(eventInterfaceLabel.interfaceLabel);
|
||||
const linkNode = this.mapLinkNodeToLinkNode.convert(eventInterfaceLabel.interfaceLabel);
|
||||
const link = this.links.find(l => l.link_id === eventInterfaceLabel.interfaceLabel.linkId);
|
||||
this.contextMenu.openMenuForInterfaceLabel(linkNode, link, eventInterfaceLabel.event.pageY, eventInterfaceLabel.event.pageX);
|
||||
});
|
||||
|
||||
const onContextMenu = this.selectionTool.contextMenuOpened.subscribe((event) => {
|
||||
|
Reference in New Issue
Block a user