Added Dokubox Sync Service and Button Fix #12
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 30s
Build and Push Docker Images / build-frontend (push) Successful in 1m10s

This commit is contained in:
2026-01-22 17:05:22 +01:00
parent 1a065b649c
commit d2b70e5883
4 changed files with 260 additions and 199 deletions

View File

@@ -11,6 +11,7 @@ const router = useRouter()
const route = useRoute()
const modal = useModal()
const toast = useToast()
const { $api } = useNuxtApp()
const files = useFiles()
// --- State ---
@@ -222,11 +223,50 @@ defineShortcuts({
'arrowdown': () => { if (selectedFileIndex.value < renderedFileList.value.length - 1) selectedFileIndex.value++ },
'arrowup': () => { if (selectedFileIndex.value > 0) selectedFileIndex.value-- }
})
const isSyncing = ref(false)
const syncdokubox = async () => {
isSyncing.value = true
try {
await $api('/api/functions/services/syncdokubox', { method: 'POST' })
toast.add({
title: 'Erfolg',
description: 'Dokubox wurde synchronisiert.',
icon: 'i-heroicons-check-circle',
color: 'green'
})
// Liste neu laden
await setupPage()
} catch (error) {
console.error(error)
toast.add({
title: 'Fehler',
description: 'Beim Synchronisieren der Dokubox ist ein Fehler aufgetreten.',
icon: 'i-heroicons-exclamation-circle',
color: 'red'
})
} finally {
isSyncing.value = false
}
}
</script>
<template>
<UDashboardNavbar title="Dateien">
<template #right>
<UButton
label="Dokubox Sync"
icon="i-heroicons-sparkles"
color="primary"
variant="solid"
:loading="isSyncing"
@click="syncdokubox"
class="mr-2"
/>
<UInput id="searchinput" v-model="searchString" icon="i-heroicons-magnifying-glass" placeholder="Suche..." class="w-64" />
</template>
</UDashboardNavbar>