mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-18 13:15:25 +02:00
refac
This commit is contained in:
@@ -356,6 +356,7 @@
|
||||
<Markdown
|
||||
id={`${message.id}-reply-to`}
|
||||
content={message?.reply_to_message?.content}
|
||||
allowEmbeds={false}
|
||||
/>
|
||||
</div>
|
||||
</button>
|
||||
@@ -527,6 +528,7 @@
|
||||
id={message.id}
|
||||
content={message.content}
|
||||
paragraphTag="span"
|
||||
allowEmbeds={!!message?.meta?.model_id}
|
||||
/>{#if message.created_at !== message.updated_at && (message?.meta?.model_id ?? null) === null}<span
|
||||
class="text-gray-500 text-[10px] pl-1 self-center">({$i18n.t('edited')})</span
|
||||
>{/if}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
export let paragraphTag = 'p';
|
||||
export let editCodeBlock = true;
|
||||
export let topPadding = false;
|
||||
export let allowEmbeds = true;
|
||||
|
||||
export let sourceIds = [];
|
||||
|
||||
@@ -104,6 +105,7 @@
|
||||
{editCodeBlock}
|
||||
{sourceIds}
|
||||
{topPadding}
|
||||
{allowEmbeds}
|
||||
{onTaskClick}
|
||||
{onSourceClick}
|
||||
{onSave}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
}> = [];
|
||||
|
||||
export let messageDone = true;
|
||||
export let allowEmbeds = true;
|
||||
|
||||
let open = $settings?.expandDetails ?? false;
|
||||
|
||||
@@ -51,6 +52,8 @@
|
||||
|
||||
// Collect all embeds from tool_calls tokens
|
||||
$: allEmbeds = (() => {
|
||||
if (!allowEmbeds) return [];
|
||||
|
||||
const result: Array<{ name: string; embed: string; args: string }> = [];
|
||||
for (const t of tokens) {
|
||||
if (t?.attributes?.type !== 'tool_calls') continue;
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
export let editCodeBlock = true;
|
||||
export let topPadding = false;
|
||||
export let allowEmbeds = true;
|
||||
|
||||
export let onSave: Function = () => {};
|
||||
export let onUpdate: Function = () => {};
|
||||
@@ -371,6 +372,7 @@
|
||||
id={`${id}-${tokenIdx}-detail-group`}
|
||||
tokens={token.items}
|
||||
messageDone={done}
|
||||
{allowEmbeds}
|
||||
>
|
||||
<div slot="content" class="space-y-1">
|
||||
{#each token.items as detailToken, detailIdx}
|
||||
|
||||
Reference in New Issue
Block a user