From 2bbda8d24e16b3664b38940e3669fb2bd14b61d2 Mon Sep 17 00:00:00 2001 From: Andreas Dinauer Date: Sat, 3 Oct 2026 19:12:27 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20audit=20log=20CSV=20download?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- app/app.vue | 34 +++++++++++++++++++++++++++++---- app/components/ObjectDetail.vue | 9 ++------- app/composables/useS3Client.ts | 8 +++++++- app/utils/download.ts | 8 ++++++++ 4 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 app/utils/download.ts diff --git a/app/app.vue b/app/app.vue index c607ce3..32c89b7 100644 --- a/app/app.vue +++ b/app/app.vue @@ -7,9 +7,20 @@ storage r9t -
- vpn_key - {{ accessKey }} +
+ +
+ vpn_key + {{ accessKey }} +
@@ -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([]) const objects = ref([]) @@ -99,6 +111,7 @@ const loadingObjects = ref(false) const errorMessage = ref(null) const objectsError = ref(null) const toastMessage = ref(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 { diff --git a/app/components/ObjectDetail.vue b/app/components/ObjectDetail.vue index 2d9b501..d3e62f7 100644 --- a/app/components/ObjectDetail.vue +++ b/app/components/ObjectDetail.vue @@ -84,6 +84,7 @@