-
Notifications
You must be signed in to change notification settings - Fork 14
Audit log #2860
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
Draft
david-crespo
wants to merge
27
commits into
main
Choose a base branch
from
audit-log
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Audit log #2860
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
0c49f07
Use WIP audit log Omicron API
benjaminleonard 91ea5ec
Stub out virtualised audit log page
benjaminleonard 5eb3ec0
Denser inputs
benjaminleonard fdb4506
Re-add missing link
benjaminleonard 35be627
Update API
benjaminleonard 82e58ac
Merge branch 'main' into audit-log
benjaminleonard 8c25eb0
Mock type fixes
benjaminleonard 9d46415
merge main, resolve conflicts, tweak some stuff
david-crespo accfe37
move audit log to a system page
david-crespo 34b7437
fix path and breadcrumbs snapshot tests
david-crespo b19f5d1
merge main, bump api, and fix type errors
david-crespo c6f5d96
take out json stuff and row expansion
david-crespo 09b1df8
don't define components in render
david-crespo 98ccb62
make fewer than 200000 mock audit log entries (fix test failure)
david-crespo 28e9807
rename auditLogs to auditLog everywhere
david-crespo f0ab97b
show user and silo IDs with middle truncation
david-crespo 0018531
put back the expandable JSON thing and fix the height
david-crespo 0f6bde1
request_uri is the full URI
david-crespo f50cc3a
camelToSnakeJson for json body
david-crespo 849e425
make HighlightJSON a normal recursive component
david-crespo 3d1b37a
fix date rendering
david-crespo ea4142a
fix a11y lint error by making rows focusable and interactive
david-crespo fb15493
update API for auth_method -> access_method
david-crespo 07dc1ea
merge main
david-crespo c1dab54
merge main
david-crespo 4703c88
sort by time descending in API call, fix timestamp col width
david-crespo 0455abe
real status code display and remove POST
david-crespo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,11 +22,25 @@ import { Badge } from '~/ui/lib/Badge' | |
import { Button } from '~/ui/lib/Button' | ||
import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' | ||
import { Spinner } from '~/ui/lib/Spinner' | ||
import { classed } from '~/util/classed' | ||
import { toSyslogDateString, toSyslogTimeString } from '~/util/date' | ||
import { docLinks } from '~/util/links' | ||
|
||
export const handle = { crumb: 'Audit Log' } | ||
|
||
// todo | ||
// might want to still render the items in case of error | ||
const ErrorState = () => { | ||
return <div>Error State</div> | ||
} | ||
|
||
// todo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'll do a skeleton state that is essentially a bunch of empty items to avoid too much layout shift when they load |
||
const LoadingState = () => { | ||
return <div>Loading State</div> | ||
} | ||
|
||
const HeaderCell = classed.div`text-mono-sm text-tertiary` | ||
|
||
// for virtualizer | ||
const estimateSize = () => 36 | ||
|
||
|
@@ -87,7 +101,7 @@ export default function SiloAuditLogsPage() { | |
overscan: 20, | ||
}) | ||
|
||
const LogTable = () => ( | ||
const logTable = ( | ||
<> | ||
<div | ||
className="relative w-full" | ||
|
@@ -115,7 +129,6 @@ export default function SiloAuditLogsPage() { | |
style={{ | ||
gridTemplateColumns: '7rem 4.25rem 180px 120px 120px 120px 300px 300px', | ||
}} | ||
onClick={() => {}} | ||
> | ||
<div className="overflow-hidden whitespace-nowrap text-mono-sm"> | ||
<span className="text-tertiary"> | ||
|
@@ -172,17 +185,6 @@ export default function SiloAuditLogsPage() { | |
</> | ||
) | ||
|
||
// todo | ||
// might want to still render the items in case of error | ||
const ErrorState = () => { | ||
return <div>Error State</div> | ||
} | ||
|
||
// todo | ||
const LoadingState = () => { | ||
return <div>Loading State</div> | ||
} | ||
|
||
return ( | ||
<> | ||
<PageHeader> | ||
|
@@ -206,18 +208,18 @@ export default function SiloAuditLogsPage() { | |
gridTemplateColumns: '7rem 4.25rem 180px 120px 120px 120px 300px 300px', | ||
}} | ||
> | ||
{['Time', 'Status', 'Operation', 'Actor', 'Access Method', 'Silo', 'Duration'].map( | ||
(header) => ( | ||
<div key={header} className="text-mono-sm text-tertiary"> | ||
{header} | ||
</div> | ||
) | ||
)} | ||
<HeaderCell>Time</HeaderCell> | ||
<HeaderCell>Status</HeaderCell> | ||
<HeaderCell>Operation</HeaderCell> | ||
<HeaderCell>Actor</HeaderCell> | ||
<HeaderCell>Access Method</HeaderCell> | ||
<HeaderCell>Silo</HeaderCell> | ||
<HeaderCell>Duration</HeaderCell> | ||
</div> | ||
|
||
<div className="!mx-0 flex h-full !w-full flex-col"> | ||
<div className="w-full flex-1" ref={parentRef}> | ||
{error ? <ErrorState /> : !isLoading ? <LogTable /> : <LoadingState />} | ||
{error ? <ErrorState /> : !isLoading ? logTable : <LoadingState />} | ||
</div> | ||
</div> | ||
</> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Probably, we could just add a banner and a refresh. What type of error could we expect here? If you were no longer authorised you'd be logged out? Just a general server error retrieving?
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.
Errors should be pretty unlikely if you can get to the page at all, so I’d say keep it very generic.