Initial implementation

This commit is contained in:
Piotr Pekala
2019-03-18 01:59:21 -07:00
parent ca42465ebc
commit e507e26cda
32 changed files with 491 additions and 13 deletions

View File

@ -0,0 +1,4 @@
<button mat-menu-item (click)="openPacketFilters()">
<mat-icon>filter_list</mat-icon>
<span>Packet filters</span>
</button>

View File

@ -0,0 +1,30 @@
import { Component, Input } from "@angular/core";
import { Link } from '../../../../../models/link';
import { Server } from '../../../../../models/server';
import { Project } from '../../../../../models/project';
import { MatDialog } from '@angular/material';
import { PacketFiltersDialogComponent } from '../../../packet-capturing/packet-filters/packet-filters.component';
@Component({
selector: 'app-packet-filters-action',
templateUrl: './packet-filters-action.component.html'
})
export class PacketFiltersActionComponent {
@Input() server: Server;
@Input() project: Project;
@Input() link: Link;
constructor(private dialog: MatDialog) {}
openPacketFilters() {
const dialogRef = this.dialog.open(PacketFiltersDialogComponent, {
width: '900px',
height: '400px',
autoFocus: false
});
let instance = dialogRef.componentInstance;
instance.server = this.server;
instance.project = this.project;
instance.link = this.link;
}
}

View File

@ -0,0 +1,4 @@
<button mat-menu-item *ngIf="!link.capturing" (click)="startCapture()">
<mat-icon>loupe</mat-icon>
<span>Start capture</span>
</button>

View File

@ -0,0 +1,26 @@
import { Component, Input } from '@angular/core';
import { Server } from '../../../../../models/server';
import { Link } from '../../../../../models/link';
import { MatDialog } from '@angular/material';
import { StartCaptureDialogComponent } from '../../../packet-capturing/start-capture/start-capture.component';
@Component({
selector: 'app-start-capture-action',
templateUrl: './start-capture-action.component.html'
})
export class StartCaptureActionComponent {
@Input() server: Server;
@Input() link: Link;
constructor(private dialog: MatDialog) {}
startCapture() {
const dialogRef = this.dialog.open(StartCaptureDialogComponent, {
width: '400px',
autoFocus: false
});
let instance = dialogRef.componentInstance;
instance.server = this.server;
instance.link = this.link;
}
}

View File

@ -26,6 +26,17 @@
[nodes]="nodes"
[drawings]="drawings"
></app-move-layer-down-action>
<app-start-capture-action
*ngIf="!projectService.isReadOnly(project) && drawings.length===0 && nodes.length===0 && links.length===1"
[server]="server"
[link]="links[0]"
></app-start-capture-action>
<app-packet-filters-action
*ngIf="!projectService.isReadOnly(project) && drawings.length===0 && nodes.length===0 && links.length===1"
[server]="server"
[project]="project"
[link]="links[0]"
></app-packet-filters-action>
<app-delete-action
*ngIf="!projectService.isReadOnly(project)"
[server]="server"