mirror of
https://github.com/open-webui/open-webui
synced 2025-05-21 21:46:22 +00:00
refac
This commit is contained in:
parent
3ba9f2aae2
commit
ff9fdc2f88
@ -16,6 +16,7 @@
|
|||||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||||
import FileItem from '$lib/components/common/FileItem.svelte';
|
import FileItem from '$lib/components/common/FileItem.svelte';
|
||||||
import Markdown from './Markdown.svelte';
|
import Markdown from './Markdown.svelte';
|
||||||
|
import Image from '$lib/components/common/Image.svelte';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
|
||||||
@ -128,7 +129,7 @@
|
|||||||
{#each message.files as file}
|
{#each message.files as file}
|
||||||
<div class={($settings?.chatBubble ?? true) ? 'self-end' : ''}>
|
<div class={($settings?.chatBubble ?? true) ? 'self-end' : ''}>
|
||||||
{#if file.type === 'image'}
|
{#if file.type === 'image'}
|
||||||
<img src={file.url} alt="input" class=" max-h-96 rounded-lg" draggable="false" />
|
<Image src={file.url} imageClassName=" max-h-96 rounded-lg" />
|
||||||
{:else}
|
{:else}
|
||||||
<FileItem
|
<FileItem
|
||||||
item={file}
|
item={file}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
export let alt = '';
|
export let alt = '';
|
||||||
|
|
||||||
export let className = ' w-full';
|
export let className = ' w-full';
|
||||||
|
export let imageClassName = 'rounded-lg';
|
||||||
|
|
||||||
let _src = '';
|
let _src = '';
|
||||||
$: _src = src.startsWith('/') ? `${WEBUI_BASE_URL}${src}` : src;
|
$: _src = src.startsWith('/') ? `${WEBUI_BASE_URL}${src}` : src;
|
||||||
@ -19,7 +20,7 @@
|
|||||||
showImagePreview = true;
|
showImagePreview = true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img src={_src} {alt} class=" rounded-lg cursor-pointer" draggable="false" data-cy="image" />
|
<img src={_src} {alt} class={imageClassName} draggable="false" data-cy="image" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<ImagePreview bind:show={showImagePreview} src={_src} {alt} />
|
<ImagePreview bind:show={showImagePreview} src={_src} {alt} />
|
||||||
|
Loading…
Reference in New Issue
Block a user