mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-15 13:28:10 +00:00
Information dialog added
This commit is contained in:
@ -0,0 +1,4 @@
|
||||
<button mat-menu-item (click)="showNode()">
|
||||
<mat-icon>info</mat-icon>
|
||||
<span>Show node information</span>
|
||||
</button>
|
@ -0,0 +1,26 @@
|
||||
import { Component, Input, OnInit, OnChanges } from '@angular/core';
|
||||
import { Node } from '../../../../../cartography/models/node';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { InfoDialogComponent } from '../../../info-dialog/info-dialog.component';
|
||||
import { Server } from '../../../../../models/server';
|
||||
|
||||
@Component({
|
||||
selector: 'app-show-node-action',
|
||||
templateUrl: './show-node-action.component.html'
|
||||
})
|
||||
export class ShowNodeActionComponent {
|
||||
@Input() node: Node;
|
||||
@Input() server: Server
|
||||
|
||||
constructor(private dialog: MatDialog) {}
|
||||
|
||||
showNode() {
|
||||
const dialogRef = this.dialog.open(InfoDialogComponent, {
|
||||
width: '600px',
|
||||
autoFocus: false
|
||||
});
|
||||
let instance = dialogRef.componentInstance;
|
||||
instance.node = this.node;
|
||||
instance.server = this.server;
|
||||
}
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
<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-start-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-start-node-action>
|
||||
<app-stop-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-stop-node-action>
|
||||
<app-console-device-action
|
||||
|
Reference in New Issue
Block a user