mirror of
https://github.com/open-webui/open-webui
synced 2024-11-21 23:57:51 +00:00
refac
This commit is contained in:
parent
81440460f2
commit
f5b6785e53
@ -17,6 +17,7 @@
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let id = '';
|
||||
export let save = false;
|
||||
|
||||
export let token;
|
||||
export let lang = '';
|
||||
@ -316,9 +317,11 @@ __builtins__.input = input`);
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<button class="copy-code-button bg-none border-none p-1" on:click={saveCode}>
|
||||
{saved ? $i18n.t('Saved') : $i18n.t('Save')}
|
||||
</button>
|
||||
{#if save}
|
||||
<button class="copy-code-button bg-none border-none p-1" on:click={saveCode}>
|
||||
{saved ? $i18n.t('Saved') : $i18n.t('Save')}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button class="copy-code-button bg-none border-none p-1" on:click={copyCode}
|
||||
>{copied ? $i18n.t('Copied') : $i18n.t('Copy')}</button
|
||||
|
@ -9,6 +9,7 @@
|
||||
export let content;
|
||||
export let model = null;
|
||||
|
||||
export let save = false;
|
||||
export let floatingButtons = true;
|
||||
|
||||
let contentContainerElement;
|
||||
@ -60,6 +61,7 @@
|
||||
{id}
|
||||
{content}
|
||||
{model}
|
||||
{save}
|
||||
on:update={(e) => {
|
||||
dispatch('update', e.detail);
|
||||
}}
|
||||
|
@ -14,6 +14,7 @@
|
||||
export let id;
|
||||
export let content;
|
||||
export let model = null;
|
||||
export let save = false;
|
||||
|
||||
let tokens = [];
|
||||
|
||||
@ -37,6 +38,7 @@
|
||||
<MarkdownTokens
|
||||
{tokens}
|
||||
{id}
|
||||
{save}
|
||||
on:update={(e) => {
|
||||
dispatch('update', e.detail);
|
||||
}}
|
||||
|
@ -17,6 +17,8 @@
|
||||
export let tokens: Token[];
|
||||
export let top = true;
|
||||
|
||||
export let save = false;
|
||||
|
||||
const headerComponent = (depth: number) => {
|
||||
return 'h' + depth;
|
||||
};
|
||||
@ -36,6 +38,7 @@
|
||||
{token}
|
||||
lang={token?.lang ?? ''}
|
||||
code={revertSanitizedResponseContent(token?.text ?? '')}
|
||||
{save}
|
||||
on:save={(e) => {
|
||||
dispatch('update', {
|
||||
oldContent: token.text,
|
||||
|
@ -478,6 +478,7 @@
|
||||
<ContentRenderer
|
||||
id={message.id}
|
||||
content={message.content}
|
||||
save={true}
|
||||
{model}
|
||||
on:update={(e) => {
|
||||
const { oldContent, newContent } = e.detail;
|
||||
|
Loading…
Reference in New Issue
Block a user