✨ Add audit log CSV download

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 19:12:27 +02:00
co-authored by Claude Opus 5.5
parent 02e5b1f4e4
commit 2bbda8d24e
4 changed files with 47 additions and 12 deletions
+30 -4
View File
@@ -7,9 +7,20 @@
<span class="material-symbols-outlined text-accent">storage</span>
<span class="text-sm font-semibold tracking-[0.04em]">r9t</span>
</div>
<div class="flex items-center gap-2 rounded-full border border-border bg-surface-raised px-3 py-1 text-xs text-muted">
<span class="material-symbols-outlined !text-[15px]">vpn_key</span>
<span class="font-mono">{{ accessKey }}</span>
<div class="flex items-center gap-2">
<button
type="button"
class="flex items-center gap-1.5 rounded-md border border-border bg-surface-raised px-3 py-1.5 text-xs text-muted transition-colors hover:text-text disabled:opacity-60"
:disabled="downloadingAuditLogs"
@click="downloadAuditLogCsv"
>
<span class="material-symbols-outlined !text-[16px]" :class="{ 'animate-spin': downloadingAuditLogs }">{{ downloadingAuditLogs ? 'progress_activity' : 'download' }}</span>
Audit Logs (CSV)
</button>
<div class="flex items-center gap-2 rounded-full border border-border bg-surface-raised px-3 py-1 text-xs text-muted">
<span class="material-symbols-outlined !text-[15px]">vpn_key</span>
<span class="font-mono">{{ accessKey }}</span>
</div>
</div>
</header>
@@ -81,6 +92,7 @@
import { ref, computed, watch, onMounted } from 'vue'
import { Popup, PopupSize } from '~/utils/popup'
import UploadPopup from '~/components/popup/UploadPopup.vue'
import { saveBlob } from '~/utils/download'
import type { S3Bucket, S3Object } from '~/utils/s3xml'
useHead({ title: 'r9t · Object Storage' })
@@ -88,7 +100,7 @@ useHead({ title: 'r9t · Object Storage' })
const config = useRuntimeConfig()
const accessKey = config.public.s3AccessKey
const { listBuckets, listObjects } = useS3Client()
const { listBuckets, listObjects, downloadAuditLogs } = useS3Client()
const buckets = ref<S3Bucket[]>([])
const objects = ref<S3Object[]>([])
@@ -99,6 +111,7 @@ const loadingObjects = ref(false)
const errorMessage = ref<string | null>(null)
const objectsError = ref<string | null>(null)
const toastMessage = ref<string | null>(null)
const downloadingAuditLogs = ref(false)
const filteredObjects = computed(() => {
if (!search.value) {
@@ -141,6 +154,19 @@ function openUploadPopup() {
)
}
async function downloadAuditLogCsv() {
downloadingAuditLogs.value = true
try {
saveBlob(await downloadAuditLogs(), 'audit-logs.csv')
}
catch {
notify('Audit Logs konnten nicht heruntergeladen werden.')
}
finally {
downloadingAuditLogs.value = false
}
}
async function loadBuckets() {
errorMessage.value = null
try {