Github user merrimanr commented on a diff in the pull request: https://github.com/apache/metron/pull/1122#discussion_r204553631 --- Diff: metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts --- @@ -0,0 +1,71 @@ +import { Component, OnInit, Input } from '@angular/core'; + +import { PcapService, PcapStatusResponse } from '../service/pcap.service'; +import { PcapRequest } from '../model/pcap.request'; +import { Pdml } from '../model/pdml'; +import {Subscription} from 'rxjs/Rx'; +import { PcapPagination } from '../model/pcap-pagination'; + +class Query { + id: String +} + +@Component({ + selector: 'app-pcap-panel', + templateUrl: './pcap-panel.component.html', + styleUrls: ['./pcap-panel.component.scss'] +}) +export class PcapPanelComponent { + + @Input() pdml: Pdml = null; + @Input() pcapRequest: PcapRequest; + @Input() resetPaginationForSearch: boolean; + + statusSubscription: Subscription; + queryRunning: boolean = false; + queryId: string; + progressWidth: number = 0; + pagination: PcapPagination = new PcapPagination(); + savedPcapRequest: {}; + selectedPage: number = 1; + + constructor(private pcapService: PcapService ) { } + + changePage(page) { + this.selectedPage = page; + this.pcapService.getPackets(this.queryId, this.selectedPage).toPromise().then(pdml => { + this.pdml = pdml; + }); + } + + onSearch(pcapRequest, resetPaginationForSearch = true, from = 1) { + this.savedPcapRequest = pcapRequest; + if (resetPaginationForSearch === true) { + pcapRequest.from = 1; --- End diff -- Shouldn't this set the selectedPage to 1? The `from` property on PcapRequest doesn't do anything. I am seeing this bug: - execute a search - navigate to page 2 in the results - execute another search - the search results are retrieved for the page I was previously on instead of the first page
---