- Notifications
You must be signed in to change notification settings - Fork947
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
to5de8705
Compare 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
to7de824c
CompareThis is ready for review, but marked as a draft so it's not merged early. |
7de824c
to20092f6
Compare33d8acb
to1e3334b
Compare20092f6
to57acd96
Compare1e3334b
to332f8da
Compare57acd96
to24dee7a
Compare332f8da
to6cd9d68
Compare5db1b73
to4be35f4
Compare4be35f4
to9239251
Compare6cd9d68
to6fa4d22
Compare9239251
to7f2dccd
Compare6fa4d22
to769b7a5
Compared6ec519
to15aac3f
Compare769b7a5
tofc195c3
Compare15aac3f
toc505c02
CompareThere 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
connectionlogsQuery
is 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_code
paths (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
todf2d839
Comparec505c02
to9238f25
Comparedf2d839
to78cc56b
Compare9238f25
to823dc41
Compare78cc56b
toe61fc41
Compare823dc41
toe364d00
Comparee61fc41
to4055dd7
Comparee364d00
tocf9592b
Compareethanndickson 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
to397ecab
Compareb5260d5
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
/connectionlog
to 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: