mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 13:58:09 +00:00
enh: apply edit to artifacts
This commit is contained in:
parent
f5e10704c0
commit
3082d0de7a
@ -6,16 +6,19 @@
|
|||||||
|
|
||||||
import { showArtifacts, showControls } from '$lib/stores';
|
import { showArtifacts, showControls } from '$lib/stores';
|
||||||
import XMark from '../icons/XMark.svelte';
|
import XMark from '../icons/XMark.svelte';
|
||||||
|
import { createMessagesList } from '$lib/utils';
|
||||||
|
|
||||||
export let messages;
|
|
||||||
export let overlay = false;
|
export let overlay = false;
|
||||||
|
export let history;
|
||||||
|
let messages = [];
|
||||||
|
|
||||||
let contents: Array<{ content: string }> = [];
|
let contents: Array<{ content: string }> = [];
|
||||||
let selectedContentIdx = 0;
|
let selectedContentIdx = 0;
|
||||||
|
|
||||||
let iframeElement: HTMLIFrameElement;
|
let iframeElement: HTMLIFrameElement;
|
||||||
|
|
||||||
$: if (messages) {
|
$: if (history.currentId) {
|
||||||
|
messages = createMessagesList(history, history.currentId);
|
||||||
getContents();
|
getContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2088,7 +2088,6 @@
|
|||||||
bind:files
|
bind:files
|
||||||
bind:pane={controlPane}
|
bind:pane={controlPane}
|
||||||
chatId={$chatId}
|
chatId={$chatId}
|
||||||
messages={createMessagesList(history.currentId)}
|
|
||||||
modelId={selectedModelIds?.at(0) ?? null}
|
modelId={selectedModelIds?.at(0) ?? null}
|
||||||
models={selectedModelIds.reduce((a, e, i, arr) => {
|
models={selectedModelIds.reduce((a, e, i, arr) => {
|
||||||
const model = $models.find((m) => m.id === e);
|
const model = $models.find((m) => m.id === e);
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
export let models = [];
|
export let models = [];
|
||||||
|
|
||||||
export let chatId = null;
|
export let chatId = null;
|
||||||
export let messages = [];
|
|
||||||
|
|
||||||
export let chatFiles = [];
|
export let chatFiles = [];
|
||||||
export let params = {};
|
export let params = {};
|
||||||
@ -126,7 +125,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{:else if $showArtifacts}
|
{:else if $showArtifacts}
|
||||||
<Artifacts {messages} />
|
<Artifacts {history} />
|
||||||
{:else if $showOverview}
|
{:else if $showOverview}
|
||||||
<Overview
|
<Overview
|
||||||
{history}
|
{history}
|
||||||
@ -201,7 +200,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{:else if $showArtifacts}
|
{:else if $showArtifacts}
|
||||||
<Artifacts {messages} overlay={dragged} />
|
<Artifacts {history} overlay={dragged} />
|
||||||
{:else if $showOverview}
|
{:else if $showOverview}
|
||||||
<Overview
|
<Overview
|
||||||
{history}
|
{history}
|
||||||
|
@ -80,6 +80,7 @@
|
|||||||
|
|
||||||
const updateChatHistory = async () => {
|
const updateChatHistory = async () => {
|
||||||
await tick();
|
await tick();
|
||||||
|
history = history;
|
||||||
await updateChatById(localStorage.token, chatId, {
|
await updateChatById(localStorage.token, chatId, {
|
||||||
history: history,
|
history: history,
|
||||||
messages: messages
|
messages: messages
|
||||||
|
Loading…
Reference in New Issue
Block a user