-
Notifications
You must be signed in to change notification settings - Fork 914
feat: support session audit log #16703
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,8 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({ | |
</Stack> | ||
|
||
<Stack direction="row" alignItems="center"> | ||
<StatusPill code={auditLog.status_code} /> | ||
|
||
{/* With multi-org, there is not enough space so show | ||
everything in a tooltip. */} | ||
{showOrgDetails ? ( | ||
|
@@ -169,6 +171,12 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({ | |
</Link> | ||
</div> | ||
)} | ||
{auditLog.additional_fields?.reason && ( | ||
<div> | ||
<h4 css={styles.auditLogInfoHeader}>Reason:</h4> | ||
<div>{auditLog.additional_fields?.reason}</div> | ||
</div> | ||
)} | ||
</div> | ||
} | ||
> | ||
|
@@ -203,13 +211,6 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({ | |
)} | ||
</Stack> | ||
)} | ||
|
||
<Pill | ||
css={styles.httpStatusPill} | ||
type={httpStatusColor(auditLog.status_code)} | ||
> | ||
{auditLog.status_code.toString()} | ||
</Pill> | ||
</Stack> | ||
</Stack> | ||
</Stack> | ||
|
@@ -218,7 +219,7 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({ | |
{shouldDisplayDiff ? ( | ||
<div> {<DropdownArrow close={isDiffOpen} />}</div> | ||
) : ( | ||
<div css={styles.columnWithoutDiff}></div> | ||
<div css={styles.columnWithoutDiff} /> | ||
)} | ||
</Stack> | ||
|
||
|
@@ -232,6 +233,19 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({ | |
); | ||
}; | ||
|
||
function StatusPill({ code }: { code: number }) { | ||
const isHttp = code >= 100; | ||
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. Actually, a better measure of http status code may be whether or not this was a connect/disconnect action. Shell errors can be 0-255, but perhaps we should just mark them as 0/1 on the API side, wdyt? 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. Hm... I think it works 👍 |
||
|
||
return ( | ||
<Pill | ||
css={styles.statusCodePill} | ||
type={isHttp ? httpStatusColor(code) : code === 0 ? "success" : "error"} | ||
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. Nice fix for this! |
||
> | ||
{code.toString()} | ||
</Pill> | ||
); | ||
} | ||
|
||
const styles = { | ||
auditLogCell: { | ||
padding: "0 !important", | ||
|
@@ -287,7 +301,7 @@ const styles = { | |
width: "100%", | ||
}, | ||
|
||
httpStatusPill: { | ||
statusCodePill: { | ||
fontSize: 10, | ||
height: 20, | ||
paddingLeft: 10, | ||
|
Uh oh!
There was an error while loading. Please reload this page.