mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 16:59:42 +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 XMark from '../icons/XMark.svelte';
|
||||
import { createMessagesList } from '$lib/utils';
|
||||
|
||||
export let messages;
|
||||
export let overlay = false;
|
||||
export let history;
|
||||
let messages = [];
|
||||
|
||||
let contents: Array<{ content: string }> = [];
|
||||
let selectedContentIdx = 0;
|
||||
|
||||
let iframeElement: HTMLIFrameElement;
|
||||
|
||||
$: if (messages) {
|
||||
$: if (history.currentId) {
|
||||
messages = createMessagesList(history, history.currentId);
|
||||
getContents();
|
||||
}
|
||||
|
||||
|
@ -2088,7 +2088,6 @@
|
||||
bind:files
|
||||
bind:pane={controlPane}
|
||||
chatId={$chatId}
|
||||
messages={createMessagesList(history.currentId)}
|
||||
modelId={selectedModelIds?.at(0) ?? null}
|
||||
models={selectedModelIds.reduce((a, e, i, arr) => {
|
||||
const model = $models.find((m) => m.id === e);
|
||||
|
@ -18,7 +18,6 @@
|
||||
export let models = [];
|
||||
|
||||
export let chatId = null;
|
||||
export let messages = [];
|
||||
|
||||
export let chatFiles = [];
|
||||
export let params = {};
|
||||
@ -126,7 +125,7 @@
|
||||
/>
|
||||
</div>
|
||||
{:else if $showArtifacts}
|
||||
<Artifacts {messages} />
|
||||
<Artifacts {history} />
|
||||
{:else if $showOverview}
|
||||
<Overview
|
||||
{history}
|
||||
@ -201,7 +200,7 @@
|
||||
/>
|
||||
</div>
|
||||
{:else if $showArtifacts}
|
||||
<Artifacts {messages} overlay={dragged} />
|
||||
<Artifacts {history} overlay={dragged} />
|
||||
{:else if $showOverview}
|
||||
<Overview
|
||||
{history}
|
||||
|
@ -80,6 +80,7 @@
|
||||
|
||||
const updateChatHistory = async () => {
|
||||
await tick();
|
||||
history = history;
|
||||
await updateChatById(localStorage.token, chatId, {
|
||||
history: history,
|
||||
messages: messages
|
||||
|
Loading…
Reference in New Issue
Block a user