Show collapsible IP check cycles in the registry
This commit is contained in:
1 parent
94124747ce
commit
b58d5f5b82
16 files changed
+332
-36
No files matched your search
@@ -37,6 +37,20 @@ func (d *DB) ListEventsForIP(ctx context.Context, ipID int64) ([]Event, error) {
|
||||
return scanEvents(rows)
|
||||
}
|
||||
|
||||
// ListEventsForRegistry includes events whose queue row has been deleted.
|
||||
func (d *DB) ListEventsForRegistry(ctx context.Context, registryID int64) ([]Event, error) {
|
||||
rows, err := d.QueryContext(ctx, `
|
||||
SELECT id, source_type, source_id, ip_id, registry_id, cycle_id, event_type, payload, occurred_at, created_at
|
||||
FROM events WHERE registry_id=? AND cycle_id>0
|
||||
ORDER BY julianday(occurred_at) DESC, id DESC
|
||||
`, registryID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
return scanEvents(rows)
|
||||
}
|
||||
|
||||
func (d *DB) ListRecentEvents(ctx context.Context, limit int) ([]Event, error) {
|
||||
rows, err := d.QueryContext(ctx, `
|
||||
SELECT id, source_type, source_id, ip_id, registry_id, cycle_id, event_type, payload, occurred_at, created_at
|
||||
|
||||
Reference in new issue
Block a user