Add connection history to the peer page and login event sources
Describe your changes
Admins have no way to see when a peer connected to Management or where it connected from. Management now records peer.connect and peer.disconnect activity events (https://github.com/netbirdio/netbird/pull/8615), and this surfaces them.
| No Events View | Events List View |
|---|---|
The peer page gets a Connection History tab listing each event with its time in UTC, the source IP, and the location recorded for that connection. Search covers events, IPs, and locations. The tab follows the layout of the neighboring tabs: a one-line helper with details in a tooltip, the standard toolbar, and the minimal table inside a card. It handles loading, empty, and error states with a retry.
In the activity log, connection events read "Peer X connected to Management from 203.0.113.24 Germany, Berlin". They reuse the existing location display from peer-added events, since Management writes the same meta keys.
History is read from the existing /events/audit endpoint, so it covers the latest 10,000 account activity events. The help tooltip says so, and also that the events describe connections to Management rather than tunnel health.
DataTable gets an opt-in autoResetPageIndex so that a refresh returning fewer rows does not leave the table on an empty page. Existing tables keep their current behavior.
Issue ticket number and link
https://github.com/netbirdio/netbird/issues/8616
Documentation
Select exactly one:
- I added/updated documentation for this change
- Documentation is not needed for this change (explain why)
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/1117
E2E tests
Optional: override the image tags used by the Playwright e2e workflow.
Defaults to main when omitted.
management-cloud-tag: main
reverse-proxy-tag: main
Summary by CodeRabbit
- New Features
- Added a Connection History tab to peer details for users with event-viewing permission. It shows sortable, searchable connection and disconnection records, including timestamps, source IPs, locations, and session durations when available.
- Added clear empty and error states, with an option to retry loading history, and a tooltip explaining history limits and caveats.
- Peer activity descriptions now show linked peer names and available connection details, including source IP, location, and disconnect duration. Dashboard login activity can also show connection location.
- Bug Fixes
- Peer tables can reset to the first page when refreshed data no longer fills the current page.