Skip to content

Commit 87d9bbe

Browse files
committed
Update
Signed-off-by: David VIEJO <dviejo@kungfusoftware.es>
1 parent 791e92b commit 87d9bbe

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

web/src/pages/settings/audit-logs.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ interface AuditLogDetails {
2020
[key: string]: any
2121
}
2222

23-
const severityColors = {
24-
INFO: 'bg-blue-500',
25-
WARNING: 'bg-yellow-500',
26-
CRITICAL: 'bg-red-500',
27-
}
23+
const severityVariants = {
24+
INFO: 'default',
25+
WARNING: 'secondary',
26+
CRITICAL: 'destructive',
27+
} as const
2828

29-
const outcomeColors = {
30-
SUCCESS: 'bg-green-500',
31-
FAILURE: 'bg-red-500',
32-
PENDING: 'bg-yellow-500',
33-
}
29+
const outcomeVariants = {
30+
SUCCESS: 'success',
31+
FAILURE: 'destructive',
32+
PENDING: 'secondary',
33+
} as const
3434

3535
export default function AuditLogsPage() {
3636
const navigate = useNavigate()
@@ -84,9 +84,9 @@ export default function AuditLogsPage() {
8484
<TableCell>{log.userIdentity || '-'}</TableCell>
8585
<TableCell>{details?.session_id || '-'}</TableCell>
8686
<TableCell>{log.eventSource || '-'}</TableCell>
87-
<TableCell>{details?.is_security_event && <Badge className="bg-red-500 text-white">Security Event</Badge>}</TableCell>
88-
<TableCell>{log.severity && <Badge className={`${severityColors[log.severity]} text-white`}>{log.severity}</Badge>}</TableCell>
89-
<TableCell>{log.eventOutcome && <Badge className={`${outcomeColors[log.eventOutcome]} text-white`}>{log.eventOutcome}</Badge>}</TableCell>
87+
<TableCell>{details?.is_security_event && <Badge variant="destructive">Security Event</Badge>}</TableCell>
88+
<TableCell>{log.severity && <Badge variant={severityVariants[log.severity] || 'default'}>{log.severity}</Badge>}</TableCell>
89+
<TableCell>{log.eventOutcome && <Badge variant={outcomeVariants[log.eventOutcome] || 'default'}>{log.eventOutcome}</Badge>}</TableCell>
9090
<TableCell>{log.affectedResource || '-'}</TableCell>
9191
</TableRow>
9292
)

web/src/pages/settings/audit-logs/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ export default function AuditLogDetailPage() {
3838
const { data, isLoading } = useQuery({
3939
...getAuditLogsByIdOptions({ path: { id: id! } }),
4040
})
41+
const details = useMemo(() => data?.details as AuditLogDetails | undefined, [data?.details])
4142

4243
if (isLoading) {
4344
return <div>Loading...</div>
4445
}
4546

46-
const details = useMemo(() => data?.details as AuditLogDetails | undefined, [data?.details])
4747
return (
4848
<div className="container mx-auto py-6">
4949
<Button variant="ghost" className="mb-4" onClick={() => navigate('/settings/audit-logs')}>

0 commit comments

Comments
 (0)