KI-AGENT: Dateivorschauen authentifiziert laden

This commit is contained in:
2026-09-07 20:10:18 +02:00
parent 2c7cd17e2b
commit dd063fd648
5 changed files with 126 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
<script setup>
const toast = useToast()
const modal = useModal()
const fileService = useFiles()
const props = defineProps({
documentData: {
@@ -68,6 +69,15 @@ const archiveDocument = async () => {
await updateDocument({archived: true}, true)
}
const openDocument = async () => {
try {
await fileService.openFile(props.documentData.id)
} catch (error) {
console.error(error)
toast.add({title: "Datei konnte nicht geöffnet werden", color: "error"})
}
}
const getItemsBySelectedResource = async () => {
idToAssign.value = null
itemOptions.value = selectedResource.value?.entity
@@ -155,11 +165,11 @@ setup()
v-if="props.documentData.id && String(props.documentData.path || '').toLowerCase().includes('pdf')"
:file-id="props.documentData.id" />
<img
<AuthenticatedFilePreview
v-else
class="w-full"
:src="props.documentData.url"
alt=""
:file-id="props.documentData.id"
:path="props.documentData.path"
/>
</div>
@@ -173,10 +183,9 @@ setup()
/>
<UButton
:to="props.documentData.url"
@click="openDocument"
variant="outline"
icon="i-heroicons-arrow-top-right-on-square"
target="_blank"
>
Öffnen
</UButton>