mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-19 01:51:15 -05:00
refac
This commit is contained in:
1 parent
6276e81cec
commit
40bf4a1b99
1 file changed
+9
-14
@@ -261,21 +261,16 @@
|
||||
<div>
|
||||
<div class=" font-normal text-lg dark:text-gray-100">
|
||||
<a
|
||||
href="#"
|
||||
href={item?.type === 'file'
|
||||
? item?.url?.startsWith('http')
|
||||
? item.url
|
||||
: `${WEBUI_API_BASE_URL}/files/${item?.id ?? item?.tempId}/content`
|
||||
: item?.type === 'collection' && item?.id
|
||||
? `/workspace/knowledge/${item.id}`
|
||||
: safeLinkUrl(item?.url)}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
class="hover:underline line-clamp-1"
|
||||
on:click|preventDefault={() => {
|
||||
if (item.type === 'file' || safeLinkUrl(item.url)) {
|
||||
let fileId = item?.id ?? item?.tempId;
|
||||
window.open(
|
||||
item.type === 'file'
|
||||
? item?.url?.startsWith('http')
|
||||
? item.url
|
||||
: `${WEBUI_API_BASE_URL}/files/${fileId}/content`
|
||||
: item.url,
|
||||
'_blank'
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{item?.name ?? 'File'}
|
||||
</a>
|
||||
|
||||
Reference in new issue
Block a user