feat: chat_file table

This commit is contained in:
Timothy Jaeryang Baek
2025-12-21 23:17:53 +04:00
parent a3458f492c
commit f1bf4f20c5
14 changed files with 382 additions and 101 deletions
+7 -1
View File
@@ -1,5 +1,7 @@
<script lang="ts">
import { createEventDispatcher, getContext } from 'svelte';
import { WEBUI_API_BASE_URL } from '$lib/constants';
import { formatFileSize } from '$lib/utils';
import { settings } from '$lib/stores';
@@ -60,7 +62,11 @@
} else {
if (url) {
if (type === 'file') {
window.open(`${url}/content`, '_blank').focus();
if (url.startsWith('http')) {
window.open(`${url}/content`, '_blank').focus();
} else {
window.open(`${WEBUI_API_BASE_URL}/files/${url}/content`, '_blank').focus();
}
} else {
window.open(`${url}`, '_blank').focus();
}
@@ -197,7 +197,11 @@
on:click|preventDefault={() => {
if (!isPDF && item.url) {
window.open(
item.type === 'file' ? `${item.url}/content` : `${item.url}`,
item.type === 'file'
? item?.url?.startsWith('http')
? item.url
: `${WEBUI_API_BASE_URL}/files/${item.url}/content`
: item.url,
'_blank'
);
}