feat: chat_file table
This commit is contained in:
1 parent
a3458f492c
commit
f1bf4f20c5
14 files changed
+382
-101
No files matched your search
@@ -343,19 +343,15 @@
|
||||
dir={$settings?.chatDirection ?? 'auto'}
|
||||
>
|
||||
{#each message?.data?.files as file}
|
||||
{@const fileUrl =
|
||||
file.url.startsWith('data') || file.url.startsWith('http')
|
||||
? file.url
|
||||
: `${WEBUI_API_BASE_URL}/files/${file.url}${file?.content_type ? '/content' : ''}`}
|
||||
<div>
|
||||
{#if file.type === 'image' || (file?.content_type ?? '').startsWith('image/')}
|
||||
<Image
|
||||
src={`${file.url}${file?.content_type ? '/content' : ''}`}
|
||||
alt={file.name}
|
||||
imageClassName=" max-h-96 rounded-lg"
|
||||
/>
|
||||
<Image src={fileUrl} alt={file.name} imageClassName=" max-h-96 rounded-lg" />
|
||||
{:else if file.type === 'video' || (file?.content_type ?? '').startsWith('video/')}
|
||||
<video
|
||||
src={`${file.url}${file?.content_type ? '/content' : ''}`}
|
||||
controls
|
||||
class=" max-h-96 rounded-lg"
|
||||
></video>
|
||||
<video src={fileUrl} controls class=" max-h-96 rounded-lg"></video>
|
||||
{:else}
|
||||
<FileItem
|
||||
item={file}
|
||||
|
||||
Reference in new issue
Block a user