This commit is contained in:
Timothy Jaeryang Baek 2025-09-13 02:33:32 +04:00
parent 49bb1255c5
commit 9208a84185

View file

@ -61,18 +61,20 @@
<Modal size="lg" bind:show> <Modal size="lg" bind:show>
<div> <div>
<div class=" flex justify-between dark:text-gray-300 px-4.5 pt-3 pb-2"> <div class=" flex justify-between dark:text-gray-300 px-4.5 pt-3 pb-2">
<div class=" text-lg font-medium self-center"> <div class=" text-lg font-medium self-center flex items-center">
{#if citation?.source?.name} {#if citation?.source?.name}
{@const document = mergedDocuments?.[0]} {@const document = mergedDocuments?.[0]}
{#if document?.metadata?.file_id || document.source?.url?.includes('http')} {#if document?.metadata?.file_id || document.source?.url?.includes('http')}
<Tooltip <Tooltip
className="w-fit" className="w-fit"
content={$i18n.t('Open file')} content={document.source?.url?.includes('http')
? $i18n.t('Open link')
: $i18n.t('Open file')}
placement="top-start" placement="top-start"
tippyOptions={{ duration: [500, 0] }} tippyOptions={{ duration: [500, 0] }}
> >
<a <a
class="hover:text-gray-500 dark:hover:text-gray-100 underline grow" class="hover:text-gray-500 dark:hover:text-gray-100 underline grow line-clamp-1"
href={document?.metadata?.file_id href={document?.metadata?.file_id
? `${WEBUI_API_BASE_URL}/files/${document?.metadata?.file_id}/content${document?.metadata?.page !== undefined ? `#page=${document.metadata.page + 1}` : ''}` ? `${WEBUI_API_BASE_URL}/files/${document?.metadata?.file_id}/content${document?.metadata?.page !== undefined ? `#page=${document.metadata.page + 1}` : ''}`
: document.source?.url?.includes('http') : document.source?.url?.includes('http')
@ -100,9 +102,9 @@
</button> </button>
</div> </div>
<div class="flex flex-col md:flex-row w-full px-6 pb-5 md:space-x-4"> <div class="flex flex-col md:flex-row w-full px-5 pb-5 md:space-x-4">
<div <div
class="flex flex-col w-full dark:text-gray-200 overflow-y-scroll max-h-[22rem] scrollbar-hidden gap-1" class="flex flex-col w-full dark:text-gray-200 overflow-y-scroll max-h-[22rem] scrollbar-thin gap-1"
> >
{#each mergedDocuments as document, documentIdx} {#each mergedDocuments as document, documentIdx}
<div class="flex flex-col w-full gap-2"> <div class="flex flex-col w-full gap-2">