feat(ui): unified audit page with server filters and live tail

This commit is contained in:
sam committed 2026-10-25 22:09:25 +11:00
1 parent 2caab17461
commit 2ce773f5a5
19 files changed
+1519 -424

No files matched your search

+7 -3
View File
@@ -5,8 +5,12 @@ import { Button } from "@/components/ui/button";
import { formatValue, type Change } from "@/lib/changes";
/** One row per changed leaf, each revertable on its own, so a reviewer keeps
* the changes they want and drops the rest before saving. */
defineProps<{ changes: Change[]; label?: (path: string) => string }>();
* the changes they want and drops the rest before saving. A read-only diff
* passes `revertable: false`. */
withDefaults(
defineProps<{ changes: Change[]; label?: (path: string) => string; revertable?: boolean }>(),
{ revertable: true },
);
defineEmits<{ revert: [change: Change] }>();
</script>
@@ -18,7 +22,7 @@ defineEmits<{ revert: [change: Change] }>();
<p class="whitespace-pre-wrap break-words text-danger"><span class="font-sans">Before: </span>{{ formatValue(change.before) }}</p>
<p class="whitespace-pre-wrap break-words text-ok"><span class="font-sans">After: </span>{{ formatValue(change.after) }}</p>
</div>
<Button variant="ghost" size="icon-sm" :aria-label="`Revert ${label ? label(change.path) : change.path}`" title="Revert" @click="$emit('revert', change)">
<Button v-if="revertable" variant="ghost" size="icon-sm" :aria-label="`Revert ${label ? label(change.path) : change.path}`" title="Revert" @click="$emit('revert', change)">
<Undo2 />
</Button>
</li>