-
Notifications
You must be signed in to change notification settings - Fork 943
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
return ( | ||
<Filter | ||
// TODO(ethanndickson): Add docs |
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
to
5de8705
Compare
3accbf8
to
7de824c
Compare
This is ready for review, but marked as a draft so it's not merged early. |
7de824c
to
20092f6
Compare
33d8acb
to
1e3334b
Compare
20092f6
to
57acd96
Compare
1e3334b
to
332f8da
Compare
57acd96
to
24dee7a
Compare
332f8da
to
6cd9d68
Compare
5db1b73
to
4be35f4
Compare
4be35f4
to
9239251
Compare
6cd9d68
to
6fa4d22
Compare
9239251
to
7f2dccd
Compare
6fa4d22
to
769b7a5
Compare
d6ec519
to
15aac3f
Compare
769b7a5
to
fc195c3
Compare
15aac3f
to
c505c02
Compare
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.
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 | Added httpStatusColor helper for status code color mapping |
site/src/utils/connection.ts | Added connectionTypeToFriendlyName and connectionTypeIsWeb |
site/src/api/queries/connectionlog.ts & api/api.ts | New paginatedConnectionLogs query and API.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 | Added viewAnyConnectionLog permission |
site/src/modules/dashboard/Navbar/**/* | Updated navigation to show Connection Log links |
site/src/components/StatusPill/StatusPill.tsx | Enhanced StatusPill to handle HTTP/SSH codes |
site/src/components/Filter/UserFilter.tsx | Added placeholder prop to UserMenu |
site/src/pages/AuditPage/**/* | Refactored to reuse new StatusPill 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";
fc195c3
to
df2d839
Compare
c505c02
to
9238f25
Compare
df2d839
to
78cc56b
Compare
9238f25
to
823dc41
Compare
78cc56b
to
e61fc41
Compare
823dc41
to
e364d00
Compare
e61fc41
to
4055dd7
Compare
e364d00
to
cf9592b
Compare
Merge activity
|
cf9592b
to
397ecab
Compare
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: