mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-20 16:20:48 +00:00
Start/stop nodes, fixes: #12
This commit is contained in:
parent
2ab96ab323
commit
4caeb2a4c7
@ -46,13 +46,8 @@ export class NodesWidget implements Widget {
|
||||
const node_image = node_enter.append<SVGImageElement>('image')
|
||||
.attr('xlink:href', (n: Node) => 'data:image/svg+xml;base64,' + btoa(n.icon.raw))
|
||||
.attr('width', (n: Node) => n.width)
|
||||
.attr('height', (n: Node) => n.height)
|
||||
.on("contextmenu", function (n: Node, i: number) {
|
||||
event.preventDefault();
|
||||
if (self.onContextMenuCallback !== null) {
|
||||
self.onContextMenuCallback(event, n);
|
||||
}
|
||||
});
|
||||
.attr('height', (n: Node) => n.height);
|
||||
|
||||
|
||||
node_enter.append<SVGCircleElement>('circle')
|
||||
.attr('class', 'node_point')
|
||||
@ -67,6 +62,12 @@ export class NodesWidget implements Widget {
|
||||
.attr('y', '0');
|
||||
|
||||
const node_merge = node.merge(node_enter)
|
||||
.on("contextmenu", function (n: Node, i: number) {
|
||||
event.preventDefault();
|
||||
if (self.onContextMenuCallback !== null) {
|
||||
self.onContextMenuCallback(event, n);
|
||||
}
|
||||
})
|
||||
.attr('transform', (n: Node) => {
|
||||
return `translate(${n.x},${n.y})`;
|
||||
});
|
||||
|
@ -25,11 +25,8 @@ import { Snapshot } from "../shared/models/snapshot";
|
||||
import { ProgressDialogService } from "../shared/progress-dialog/progress-dialog.service";
|
||||
import { ProgressDialogComponent } from "../shared/progress-dialog/progress-dialog.component";
|
||||
import { ToastyService } from "ng2-toasty";
|
||||
import {Drawing} from "../cartography/shared/models/drawing.model";
|
||||
import {StartNodeAction} from "../shared/node-context-menu/actions/start-node-action";
|
||||
import {NodeService} from "../shared/services/node.service";
|
||||
import {StopNodeAction} from "../shared/node-context-menu/actions/stop-node-action";
|
||||
import {NodeContextMenuComponent} from "../shared/node-context-menu/node-context-menu.component";
|
||||
import { Drawing } from "../cartography/shared/models/drawing.model";
|
||||
import { NodeContextMenuComponent } from "../shared/node-context-menu/node-context-menu.component";
|
||||
|
||||
|
||||
@Component({
|
||||
@ -58,7 +55,6 @@ export class ProjectMapComponent implements OnInit {
|
||||
private projectService: ProjectService,
|
||||
private symbolService: SymbolService,
|
||||
private snapshotService: SnapshotService,
|
||||
private nodeService: NodeService,
|
||||
private dialog: MatDialog,
|
||||
private progressDialogService: ProgressDialogService,
|
||||
private toastyService: ToastyService) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user