feat(frontend): show "query sensitive data" in audit log

This commit is contained in:
sam 2024-12-27 17:49:29 -05:00
parent 12eddb9949
commit 9d3d46bf33
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
4 changed files with 17 additions and 4 deletions

View file

@ -58,6 +58,7 @@ export enum AuditLogEntryType {
WarnUser = "WARN_USER",
WarnUserAndClearProfile = "WARN_USER_AND_CLEAR_PROFILE",
SuspendUser = "SUSPEND_USER",
QuerySensitiveUserData = "QUERY_SENSITIVE_USER_DATA",
}
export type PartialReport = {

View file

@ -12,10 +12,6 @@
let date = $derived(idTimestamp(entry.id).toLocaleString(DateTime.DATETIME_MED));
</script>
<svelte:head>
<title>Audit log</title>
</svelte:head>
<div class="card my-1 p-2">
<h6 class="d-flex">
<span class="flex-grow-1">
@ -26,6 +22,8 @@
warned
{:else if entry.type === "SUSPEND_USER"}
suspended
{:else if entry.type === "QUERY_SENSITIVE_USER_DATA"}
looked up sensitive data of
{:else}
(unknown action <code>{entry.type}</code>)
{/if}

View file

@ -6,6 +6,10 @@
let { data }: Props = $props();
</script>
<svelte:head>
<title>Admin dashboard • pronouns.cc</title>
</svelte:head>
<h1>Dashboard</h1>
<div class="row gx-3 gy-3">

View file

@ -45,6 +45,10 @@
};
</script>
<svelte:head>
<title>Audit log • pronouns.cc</title>
</svelte:head>
<h1>Audit log</h1>
<div class="btn-group">
@ -68,6 +72,12 @@
<DropdownItem href={addTypeFilter("SuspendUser")} active={data.type === "SuspendUser"}>
Suspend user
</DropdownItem>
<DropdownItem
href={addTypeFilter("QuerySensitiveUserData")}
active={data.type === "QuerySensitiveUserData"}
>
Query sensitive user data
</DropdownItem>
{#if data.type}
<DropdownItem href={addTypeFilter(null)}>Remove filter</DropdownItem>
{/if}