mirror of
https://github.com/open-webui/open-webui.git
synced 2026-04-29 17:06:40 -05:00
refac
This commit is contained in:
@@ -385,27 +385,27 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if isImage}
|
{#if isImage}
|
||||||
<div class="relative w-full max-h-[70vh] overflow-hidden">
|
<div class="relative w-full max-h-[70vh] overflow-hidden">
|
||||||
<div class="absolute top-2 right-2 z-10">
|
<div class="absolute top-2 right-2 z-10">
|
||||||
<Tooltip content={$i18n.t('Reset view')}>
|
<Tooltip content={$i18n.t('Reset view')}>
|
||||||
<button
|
<button
|
||||||
class="p-1.5 rounded-lg bg-white/80 dark:bg-gray-850/80 backdrop-blur-sm shadow-sm hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
class="p-1.5 rounded-lg bg-white/80 dark:bg-gray-850/80 backdrop-blur-sm shadow-sm hover:bg-gray-100 dark:hover:bg-gray-800 transition text-gray-500 dark:text-gray-400"
|
||||||
on:click={resetImageView}
|
on:click={resetImageView}
|
||||||
>
|
>
|
||||||
<Reset className="size-4" />
|
<Reset className="size-4" />
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
<div use:initImagePanzoom>
|
||||||
|
<img
|
||||||
|
src={`${WEBUI_API_BASE_URL}/files/${item.id}/content`}
|
||||||
|
alt={item?.name ?? 'Image'}
|
||||||
|
class="w-full object-contain rounded-lg"
|
||||||
|
loading="lazy"
|
||||||
|
draggable="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div use:initImagePanzoom>
|
|
||||||
<img
|
|
||||||
src={`${WEBUI_API_BASE_URL}/files/${item.id}/content`}
|
|
||||||
alt={item?.name ?? 'Image'}
|
|
||||||
class="w-full object-contain rounded-lg"
|
|
||||||
loading="lazy"
|
|
||||||
draggable="false"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{:else if selectedTab === ''}
|
{:else if selectedTab === ''}
|
||||||
{#if item?.file?.data}
|
{#if item?.file?.data}
|
||||||
{@const rawContent = (item?.file?.data?.content ?? '').trim() || 'No content'}
|
{@const rawContent = (item?.file?.data?.content ?? '').trim() || 'No content'}
|
||||||
|
|||||||
@@ -224,7 +224,9 @@
|
|||||||
{@const resultStr = String(parsedResult)}
|
{@const resultStr = String(parsedResult)}
|
||||||
{@const isTruncated = resultStr.length > RESULT_PREVIEW_LIMIT && !expandedResult}
|
{@const isTruncated = resultStr.length > RESULT_PREVIEW_LIMIT && !expandedResult}
|
||||||
<pre
|
<pre
|
||||||
class="text-xs text-gray-600 dark:text-gray-300 whitespace-pre-wrap break-words font-mono">{isTruncated ? resultStr.slice(0, RESULT_PREVIEW_LIMIT) : resultStr}</pre>
|
class="text-xs text-gray-600 dark:text-gray-300 whitespace-pre-wrap break-words font-mono">{isTruncated
|
||||||
|
? resultStr.slice(0, RESULT_PREVIEW_LIMIT)
|
||||||
|
: resultStr}</pre>
|
||||||
{#if isTruncated}
|
{#if isTruncated}
|
||||||
<button
|
<button
|
||||||
class="mt-1 text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition"
|
class="mt-1 text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition"
|
||||||
|
|||||||
Reference in New Issue
Block a user