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", WarnUser = "WARN_USER",
WarnUserAndClearProfile = "WARN_USER_AND_CLEAR_PROFILE", WarnUserAndClearProfile = "WARN_USER_AND_CLEAR_PROFILE",
SuspendUser = "SUSPEND_USER", SuspendUser = "SUSPEND_USER",
QuerySensitiveUserData = "QUERY_SENSITIVE_USER_DATA",
} }
export type PartialReport = { export type PartialReport = {

View file

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

View file

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

View file

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