Skip to content

Commit

Permalink
events: fix pager
Browse files Browse the repository at this point in the history
Github issue:
#92
  • Loading branch information
jasonish committed Jan 28, 2019
1 parent 0cf6b0c commit dc4f119
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
v2 alerts. Best to remove it until an alternate metric can be used
to report on DNS responses. Closes
https://github.com/jasonish/evebox/issues/72.
- Fixed pager button on "Events"
view. https://github.com/jasonish/evebox/issues/92

[Full Changelog](https://github.com/jasonish/evebox/compare/0.10.1..master)

Expand Down
8 changes: 6 additions & 2 deletions webapp/src/app/events.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ export class EventsComponent implements OnInit, OnDestroy {
let qp: any = this.route.snapshot.queryParams;

this.queryString = params.q || qp.q || "";
this.timeStart = params.minTs || qp.minTs;
this.timeEnd = params.maxTs || qp.maxTs;
this.timeStart = params.timeStart || qp.timeStart;
this.timeEnd = params.timeEnd || qp.timeEnd;

if (params.eventType) {
this.setEventTypeFilterByEventType(params.eventType);
Expand Down Expand Up @@ -240,6 +240,7 @@ export class EventsComponent implements OnInit, OnDestroy {
}

gotoOlder() {
console.log(`gotoOlder: timeEnd=${this.model.oldestTimestamp}`);
this.appService.updateParams(this.route, {
timeEnd: this.model.oldestTimestamp,
timeStart: undefined,
Expand Down Expand Up @@ -288,6 +289,9 @@ export class EventsComponent implements OnInit, OnDestroy {
if (events.length > 0) {
this.model.newestTimestamp = events[0]._source["@timestamp"];
this.model.oldestTimestamp = events[events.length - 1]._source["@timestamp"];

console.log(`Newest event: ${this.model.newestTimestamp}`);
console.log(`Oldest event: ${this.model.oldestTimestamp}`);
}
this.model.events = events;
}, (error) => {
Expand Down

0 comments on commit dc4f119

Please sign in to comment.