- Notifications
You must be signed in to change notification settings - Fork1.1k
feat(site): add connection log page#18708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ethanndickson commentedJul 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
| return( | ||
| <Filter | ||
| // TODO(ethanndickson): Add docs |
ethanndicksonJul 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Will be done in this PR stack.
f9333f1 to5de8705Compare This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
3accbf8 to7de824cCompareethanndickson commentedJul 2, 2025
This is ready for review, but marked as a draft so it's not merged early. |
7de824c to20092f6Compare33d8acb to1e3334bCompare20092f6 to57acd96Compare1e3334b to332f8daCompare57acd96 to24dee7aCompare332f8da to6cd9d68Compare5db1b73 to4be35f4Compare4be35f4 to9239251Compare6cd9d68 to6fa4d22Compare9239251 to7f2dccdCompare6fa4d22 to769b7a5Compared6ec519 to15aac3fCompare769b7a5 tofc195c3Compare15aac3f toc505c02CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR introduces a new Connection Log page in the frontend, mirroring the existing audit log structure but showing connection sessions, start/end times, and status codes.
- Added utilities and API endpoints for fetching and color-coding connection logs.
- Created ConnectionLogPage and related components (row, description, filter, help tooltip) plus stories and tests.
- Updated router, permissions, and navigation (Navbar, MobileMenu, DeploymentDropdown) to include the new page.
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| site/src/utils/http.ts | AddedhttpStatusColor helper for status code color mapping |
| site/src/utils/connection.ts | AddedconnectionTypeToFriendlyName andconnectionTypeIsWeb |
| site/src/api/queries/connectionlog.ts & api/api.ts | New paginatedConnectionLogs query andAPI.getConnectionLogs |
| site/src/testHelpers/entities.ts | New mocks for connection log entitlements and entries |
| site/src/router.tsx | Registered/connectionlog route |
| site/src/pages/ConnectionLogPage/**/* | New page components, stories, filter, tooltip & tests |
| site/src/modules/permissions/index.ts | AddedviewAnyConnectionLog permission |
| site/src/modules/dashboard/Navbar/**/* | Updated navigation to show Connection Log links |
| site/src/components/StatusPill/StatusPill.tsx | EnhancedStatusPill to handle HTTP/SSH codes |
| site/src/components/Filter/UserFilter.tsx | Addedplaceholder prop toUserMenu |
| site/src/pages/AuditPage/**/* | Refactored to reuse newStatusPill for HTTP codes |
Comments suppressed due to low confidence (2)
site/src/pages/ConnectionLogPage/ConnectionLogPage.tsx:28
- [nitpick] The variable name
connectionlogsQueryis lower-camel but the second word isn’t capitalized (connectionLogsQuery). Renaming for consistent camelCase improves readability.
const connectionlogsQuery = usePaginatedQuery(site/src/pages/ConnectionLogPage/ConnectionLogRow/ConnectionLogDescription/ConnectionLogDescription.tsx:1
- There are no unit tests covering
ConnectionLogDescription. Adding tests for each connection type and variousstatus_codepaths (e.g., redirect, error, unauthenticated) would ensure correct rendering logic.
import Link from "@mui/material/Link";Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fc195c3 todf2d839Comparec505c02 to9238f25Comparedf2d839 to78cc56bCompare9238f25 to823dc41Compare78cc56b toe61fc41Compare823dc41 toe364d00Comparee61fc41 to4055dd7Comparee364d00 tocf9592bCompareethanndickson commentedJul 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Merge activity
|
cf9592b to397ecabCompareb5260d5 intomainUh oh!
There was an error while loading.Please reload this page.

Uh oh!
There was an error while loading.Please reload this page.
This is the fourth PR for moving connection events out of the audit log.
This PR adds
/connectionlogto the frontend. This page is identical in structure to the audit log, but with different filters and contents.The connection log lists sessions, and the time they start. If we support tracking the end time of a session, and we've received a disconnect event for that session, the end timestamp is also included.
Demo:
connectionlogdemo2.mov
Since the styling is identical to that of the audit log, I've continued to use MUI table components. When the audit log is migrated off MUI/restyled, this table can be too, relatively easily.
Future PRs: