Show collapsible IP check cycles in the registry

This commit is contained in:
ayurishchev committed 2026-11-23 11:53:08 +03:00
1 parent 94124747ce
commit b58d5f5b82
16 files changed
+332 -36

No files matched your search

+14
View File
@@ -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