Hide layer up/down when project is readonly

This commit is contained in:
ziajka 2018-05-17 16:54:09 +02:00
parent edcf42cf77
commit bd54786f20
3 changed files with 13 additions and 11 deletions

View File

@ -21,7 +21,7 @@
</button>
</mat-menu>
<mat-toolbar-row>
<mat-toolbar-row *ngIf="!project.readonly">
<button mat-icon-button [color]="drawLineMode ? 'primary': 'basic'" (click)="toggleDrawLineMode()">
<mat-icon>timeline</mat-icon>
</button>
@ -33,20 +33,20 @@
</button>
</mat-toolbar-row>
<mat-toolbar-row>
<mat-toolbar-row *ngIf="!project.readonly" >
<button mat-icon-button (click)="createSnapshotModal()">
<mat-icon>snooze</mat-icon>
</button>
</mat-toolbar-row>
<mat-toolbar-row>
<mat-toolbar-row *ngIf="!project.readonly" >
<app-appliance [server]="server" (onNodeCreation)="onNodeCreation($event)"></app-appliance>
</mat-toolbar-row>
</mat-toolbar>
</div>
<app-node-context-menu [server]="server"></app-node-context-menu>
<app-node-context-menu [project]="project" [server]="server"></app-node-context-menu>
<app-node-select-interface (onChooseInterface)="onChooseInterface($event)"></app-node-select-interface>
</div>

View File

@ -3,7 +3,7 @@
<mat-menu #contextMenu="matMenu">
<app-start-node-action [server]="server" [node]="node"></app-start-node-action>
<app-stop-node-action [server]="server" [node]="node"></app-stop-node-action>
<app-move-layer-up-action [server]="server" [node]="node"></app-move-layer-up-action>
<app-move-layer-down-action [server]="server" [node]="node"></app-move-layer-down-action>
<app-move-layer-up-action *ngIf="!project.readonly" [server]="server" [node]="node"></app-move-layer-up-action>
<app-move-layer-down-action *ngIf="!project.readonly" [server]="server" [node]="node"></app-move-layer-down-action>
</mat-menu>
</div>

View File

@ -3,6 +3,7 @@ import {MatMenuTrigger} from "@angular/material";
import { DomSanitizer } from "@angular/platform-browser";
import { Node } from "../../cartography/shared/models/node";
import { Server } from "../models/server";
import { Project } from "../models/project";
@Component({
@ -11,6 +12,7 @@ import {Server} from "../models/server";
styleUrls: ['./node-context-menu.component.scss']
})
export class NodeContextMenuComponent implements OnInit {
@Input() project: Project;
@Input() server: Server;
@ViewChild(MatMenuTrigger) contextMenu: MatMenuTrigger;