KI-AGENT: Dateivorschauen authentifiziert laden
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user