gns3-web-ui/src/app/components/project-map/context-menu/context-menu.component.html
2019-09-20 07:01:28 -07:00

125 lines
5.2 KiB
HTML

<div class="context-menu" [style.left]="leftPosition" [style.top]="topPosition">
<span [matMenuTriggerFor]="contextMenu"></span>
<mat-menu #contextMenu="matMenu" class="context-menu-items">
<app-show-node-action *ngIf="nodes.length===1"
[server]="server"
[node]="nodes[0]"
></app-show-node-action>
<app-config-node-action *ngIf="nodes.length===1"
[server]="server"
[node]="nodes[0]"
></app-config-node-action>
<app-start-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-start-node-action>
<app-suspend-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-suspend-node-action>
<app-stop-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-stop-node-action>
<app-reload-node-action
*ngIf="nodes.length" [server]="server" [nodes]="nodes"
></app-reload-node-action>
<app-console-device-action
*ngIf="!projectService.isReadOnly(project) && nodes.length && isElectronApp"
[server]="server"
[nodes]="nodes"
></app-console-device-action>
<app-console-device-action-browser
*ngIf="!projectService.isReadOnly(project) && nodes.length===1 && !isElectronApp"
[server]="server"
[node]="nodes[0]"
></app-console-device-action-browser>
<app-change-symbol-action
*ngIf="!projectService.isReadOnly(project) && nodes.length===1"
[server]="server"
[node]="nodes[0]"
></app-change-symbol-action>
<app-duplicate-action *ngIf="drawings.length>0 || nodes.length>0"
[server]="server"
[project]="project"
[nodes]="nodes"
[drawings]="drawings"
></app-duplicate-action>
<app-edit-style-action *ngIf="!projectService.isReadOnly(project) && drawings.length===1 && !hasTextCapabilities"
[server]="server"
[project]="project"
[drawing]="drawings[0]"
></app-edit-style-action>
<app-edit-text-action
*ngIf="!projectService.isReadOnly(project) &&
(drawings.length===1 && hasTextCapabilities && labels.length===0 && linkNodes.length===0 ||
labels.length===1 && linkNodes.length===0 && drawings.length===0 ||
linkNodes.length===1 && labels.length===0 && drawings.length===0)"
[server]="server"
[project]="project"
[drawing]="drawings[0]"
[node]="nodes[0]"
[label]="labels[0]"
[link]="links[0]"
[linkNode]="linkNodes[0]"
></app-edit-text-action>
<app-edit-config-action *ngIf="nodes.length===1 && nodes[0].node_type==='vpcs'"
[server]="server"
[project]="project"
[node]="nodes[0]"
></app-edit-config-action>
<app-export-config-action *ngIf="nodes.length===1 && nodes[0].node_type==='vpcs'"
[server]="server"
[node]="nodes[0]"
></app-export-config-action>
<!-- <app-import-config-action *ngIf="nodes.length===1"
[server]="server"
[node]="nodes[0]"
></app-import-config-action> -->
<app-move-layer-up-action
*ngIf="!projectService.isReadOnly(project) && (drawings.length || nodes.length) && labels.length===0"
[server]="server"
[nodes]="nodes"
[drawings]="drawings"
></app-move-layer-up-action>
<app-move-layer-down-action
*ngIf="!projectService.isReadOnly(project) && (drawings.length || nodes.length) && labels.length===0"
[server]="server"
[nodes]="nodes"
[drawings]="drawings"
></app-move-layer-down-action>
<app-bring-to-front-action
*ngIf="!projectService.isReadOnly(project) && (drawings.length || nodes.length) && labels.length===0"
[server]="server"
[nodes]="nodes"
[drawings]="drawings"
></app-bring-to-front-action>
<app-start-capture-action
*ngIf="!projectService.isReadOnly(project) && isBundledServer
&& drawings.length===0 && nodes.length===0 && links.length===1"
[server]="server"
[link]="links[0]"
></app-start-capture-action>
<app-stop-capture-action
*ngIf="!projectService.isReadOnly(project) && isBundledServer
&& drawings.length===0 && nodes.length===0 && links.length===1 && linkNodes.length === 0"
[server]="server"
[link]="links[0]"
></app-stop-capture-action>
<app-packet-filters-action
*ngIf="!projectService.isReadOnly(project) && drawings.length===0 && nodes.length===0 && links.length===1 && linkNodes.length === 0"
[server]="server"
[project]="project"
[link]="links[0]"
></app-packet-filters-action>
<app-resume-link-action
*ngIf="!projectService.isReadOnly(project) && drawings.length===0 && nodes.length===0 && links.length===1 && linkNodes.length === 0"
[server]="server"
[link]="links[0]"
></app-resume-link-action>
<app-suspend-link-action
*ngIf="!projectService.isReadOnly(project) && drawings.length===0 && nodes.length===0 && links.length===1 && linkNodes.length === 0"
[server]="server"
[link]="links[0]"
></app-suspend-link-action>
<app-delete-action
*ngIf="!projectService.isReadOnly(project) && (drawings.length>0 || nodes.length>0 || links.length>0) && linkNodes.length === 0"
[server]="server"
[nodes]="nodes"
[drawings]="drawings"
[links]="links"
></app-delete-action>
</mat-menu>
</div>