Merge branch 'open-webui:main' into correct-markdown-rendering-model-descriptions

This commit is contained in:
Classic298
2025-06-16 21:11:18 +02:00
committed by GitHub
153 changed files with 8216 additions and 3021 deletions
@@ -188,9 +188,8 @@
</div>
<div slot="content">
<div class="flex text-xs font-medium flex-wrap">
{#each citations as citation, idx}
{#each citations.slice(2) as citation, idx}
<button
id={`source-${id}-${idx + 1}`}
class="no-toggle outline-hidden flex dark:text-gray-300 p-1 bg-gray-50 hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-850 transition rounded-xl max-w-96"
on:click={() => {
showCitationModal = true;
@@ -199,7 +198,7 @@
>
{#if citations.every((c) => c.distances !== undefined)}
<div class="bg-gray-50 dark:bg-gray-800 rounded-full size-4">
{idx + 1}
{idx + 3}
</div>
{/if}
<div class="flex-1 mx-1 truncate">
@@ -109,7 +109,7 @@
>
{decodeString(document?.metadata?.name ?? document.source.name)}
</a>
{#if document?.metadata?.page}
{#if Number.isInteger(document?.metadata?.page)}
<span class="text-xs text-gray-500 dark:text-gray-400">
({$i18n.t('page')}
{document.metadata.page + 1})
@@ -69,6 +69,21 @@
>
</iframe>
{/if}
{:else if token.text && token.text.includes('<iframe')}
{@const match = token.text.match(/<iframe\s+[^>]*src="([^"]+)"[^>]*><\/iframe>/)}
{@const iframeSrc = match && match[1]}
{#if iframeSrc}
<iframe
class="w-full my-2"
src={iframeSrc}
title="Embedded content"
frameborder="0"
sandbox
onload="this.style.height=(this.contentWindow.document.body.scrollHeight+20)+'px';"
></iframe>
{:else}
{token.text}
{/if}
{:else if token.text.includes(`<file type="html"`)}
{@const match = token.text.match(/<file type="html" id="([^"]+)"/)}
{@const fileId = match && match[1]}
@@ -78,7 +93,7 @@
src={`${WEBUI_BASE_URL}/api/v1/files/${fileId}/content/html`}
title="Content"
frameborder="0"
sandbox="allow-scripts{($settings?.iframeSandboxAllowForms ?? false)
sandbox="allow-scripts allow-downloads{($settings?.iframeSandboxAllowForms ?? false)
? ' allow-forms'
: ''}{($settings?.iframeSandboxAllowSameOrigin ?? false) ? ' allow-same-origin' : ''}"
referrerpolicy="strict-origin-when-cross-origin"
@@ -225,7 +225,7 @@
<div
class=" snap-center w-full max-w-full m-1 border {history.messages[messageId]
?.modelIdx == modelIdx
? `border-gray-100 dark:border-gray-850 border-[1.5px] ${
? `bg-gray-50 dark:bg-gray-850 border-gray-100 dark:border-gray-800 border-2 ${
$mobile ? 'min-w-full' : 'min-w-80'
}`
: `border-gray-100 dark:border-gray-850 border-dashed ${
@@ -605,7 +605,7 @@
<ProfileImage
src={model?.info?.meta?.profile_image_url ??
($i18n.language === 'dg-DG' ? `/doge.png` : `${WEBUI_BASE_URL}/static/favicon.png`)}
className={'size-8'}
className={'size-8 assistant-message-profile-image'}
/>
</div>
@@ -15,8 +15,10 @@
<div class="flex flex-col text-left gap-1 mt-1.5">
{#each followUps as followUp, idx (idx)}
<button
class=" mr-2 py-1.5 bg-transparent text-left text-sm flex items-center gap-2 px-1.5 text-gray-500 dark:text-gray-400 hover:text-black dark:hover:text-white transition"
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class=" mr-2 py-1.5 bg-transparent text-left text-sm flex items-center gap-2 px-1.5 text-gray-500 dark:text-gray-400 hover:text-black dark:hover:text-white transition cursor-pointer"
on:click={() => onClick(followUp)}
title={followUp}
aria-label={followUp}
@@ -26,7 +28,7 @@
<div class="line-clamp-1">
{followUp}
</div>
</button>
</div>
{#if idx < followUps.length - 1}
<hr class="border-gray-100 dark:border-gray-850" />
@@ -107,7 +107,11 @@
}}
/>
<div class=" flex w-full user-message" dir={$settings.chatDirection} id="message-{message.id}">
<div
class=" flex w-full user-message group"
dir={$settings.chatDirection}
id="message-{message.id}"
>
{#if !($settings?.chatBubble ?? true)}
<div class={`shrink-0 ltr:mr-3 rtl:ml-3`}>
<ProfileImage
@@ -115,7 +119,7 @@
? ($models.find((m) => m.id === message.user)?.info?.meta?.profile_image_url ??
'/user.png')
: (user?.profile_image_url ?? '/user.png')}
className={'size-8'}
className={'size-8 user-message-profile-image'}
/>
</div>
{/if}
@@ -143,6 +147,16 @@
{/if}
</Name>
</div>
{:else if message.timestamp}
<div class="flex justify-end pb-1 pr-2">
<div
class="text-xs invisible group-hover:visible text-gray-400 font-medium first-letter:capitalize translate-y-[1px]"
>
<Tooltip content={dayjs(message.timestamp * 1000).format('LLLL')}>
<span class="line-clamp-1">{formatDate(message.timestamp * 1000)}</span>
</Tooltip>
</div>
</div>
{/if}
<div class="chat-{message.role} w-full min-w-full markdown-prose">