Capturing packets visible on map

This commit is contained in:
Piotr Pekala
2019-03-18 06:40:06 -07:00
parent e507e26cda
commit 2997d1ff66
21 changed files with 167 additions and 38 deletions

View File

@ -0,0 +1,4 @@
<button mat-menu-item *ngIf="link.suspend" (click)="resumeLink()">
<mat-icon>play_arrow</mat-icon>
<span>Resume</span>
</button>

View File

@ -0,0 +1,22 @@
import { Component, Input } from '@angular/core';
import { Server } from '../../../../../models/server';
import { Link } from '../../../../../models/link';
import { LinkService } from '../../../../../services/link.service';
@Component({
selector: 'app-resume-link-action',
templateUrl: './resume-link-action.component.html'
})
export class ResumeLinkActionComponent {
@Input() server: Server;
@Input() link: Link;
constructor(
private linkService: LinkService
) {}
resumeLink() {
this.link.suspend = false;
this.linkService.updateLink(this.server, this.link).subscribe(() => {});
}
}

View File

@ -0,0 +1,4 @@
<button mat-menu-item *ngIf="link.capturing" (click)="stopCapture()">
<mat-icon>pause_circle_filled</mat-icon>
<span>Stop capture</span>
</button>

View File

@ -0,0 +1,21 @@
import { Component, Input } from '@angular/core';
import { Server } from '../../../../../models/server';
import { Link } from '../../../../../models/link';
import { LinkService } from '../../../../../services/link.service';
@Component({
selector: 'app-stop-capture-action',
templateUrl: './stop-capture-action.component.html'
})
export class StopCaptureActionComponent {
@Input() server: Server;
@Input() link: Link;
constructor(
private linkService: LinkService
) {}
stopCapture() {
this.linkService.stopCaptureOnLink(this.server, this.link).subscribe(() => {});
}
}

View File

@ -0,0 +1,4 @@
<button mat-menu-item *ngIf="!link.suspend" (click)="suspendLink()">
<mat-icon>pause</mat-icon>
<span>Suspend</span>
</button>

View File

@ -0,0 +1,22 @@
import { Component, Input } from '@angular/core';
import { Server } from '../../../../../models/server';
import { Link } from '../../../../../models/link';
import { LinkService } from '../../../../../services/link.service';
@Component({
selector: 'app-suspend-link-action',
templateUrl: './suspend-link-action.component.html'
})
export class SuspendLinkActionComponent {
@Input() server: Server;
@Input() link: Link;
constructor(
private linkService: LinkService
) {}
suspendLink() {
this.link.suspend = true;
this.linkService.updateLink(this.server, this.link).subscribe(() => {});
}
}

View File

@ -31,12 +31,27 @@
[server]="server"
[link]="links[0]"
></app-start-capture-action>
<app-stop-capture-action
*ngIf="!projectService.isReadOnly(project) && drawings.length===0 && nodes.length===0 && links.length===1"
[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"
[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"
[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"
[server]="server"
[link]="links[0]"
></app-suspend-link-action>
<app-delete-action
*ngIf="!projectService.isReadOnly(project)"
[server]="server"