mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
refac
This commit is contained in:
parent
bcfe1a087f
commit
3c80219808
3 changed files with 13 additions and 18 deletions
|
|
@ -158,16 +158,6 @@
|
||||||
this.setupEventListeners();
|
this.setupEventListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
onConnect() {
|
|
||||||
this.isConnected = true;
|
|
||||||
this.joinDocument();
|
|
||||||
}
|
|
||||||
|
|
||||||
onDisconnect() {
|
|
||||||
this.isConnected = false;
|
|
||||||
this.synced = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
setupEventListeners() {
|
setupEventListeners() {
|
||||||
// Listen for document updates from server
|
// Listen for document updates from server
|
||||||
this.socket.on('yjs:document:update', (data) => {
|
this.socket.on('yjs:document:update', (data) => {
|
||||||
|
|
@ -299,6 +289,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onConnect() {
|
||||||
|
this.isConnected = true;
|
||||||
|
this.joinDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
onDisconnect() {
|
||||||
|
this.isConnected = false;
|
||||||
|
this.synced = false;
|
||||||
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.socket.off('yjs:document:update');
|
this.socket.off('yjs:document:update');
|
||||||
this.socket.off('yjs:document:state');
|
this.socket.off('yjs:document:state');
|
||||||
|
|
|
||||||
|
|
@ -927,7 +927,7 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class=" flex-1 w-full h-full overflow-auto px-3.5 pb-20 relative z-40 pt-2.5"
|
class=" flex-1 w-full h-full overflow-auto px-3.5 pb-20 relative pt-2.5"
|
||||||
id="note-content-container"
|
id="note-content-container"
|
||||||
>
|
>
|
||||||
{#if enhancing}
|
{#if enhancing}
|
||||||
|
|
@ -976,14 +976,14 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
|
||||||
bind:this={inputElement}
|
bind:this={inputElement}
|
||||||
bind:editor
|
bind:editor
|
||||||
className="input-prose-sm px-0.5"
|
className="input-prose-sm px-0.5"
|
||||||
|
json={true}
|
||||||
bind:value={note.data.content.json}
|
bind:value={note.data.content.json}
|
||||||
html={note.data?.content?.html}
|
html={note.data?.content?.html}
|
||||||
json={true}
|
|
||||||
link={true}
|
|
||||||
documentId={`note:${note.id}`}
|
documentId={`note:${note.id}`}
|
||||||
collaboration={true}
|
collaboration={true}
|
||||||
socket={$socket}
|
socket={$socket}
|
||||||
user={$user}
|
user={$user}
|
||||||
|
link={true}
|
||||||
placeholder={$i18n.t('Write something...')}
|
placeholder={$i18n.t('Write something...')}
|
||||||
editable={versionIdx === null && !enhancing}
|
editable={versionIdx === null && !enhancing}
|
||||||
onChange={(content) => {
|
onChange={(content) => {
|
||||||
|
|
|
||||||
|
|
@ -281,11 +281,6 @@ Based on the user's instruction, update and enhance the existing notes by incorp
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
|
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
if (editorEnabled) {
|
|
||||||
insertNoteHandler();
|
|
||||||
}
|
|
||||||
|
|
||||||
await chatCompletionHandler();
|
await chatCompletionHandler();
|
||||||
messages = messages.map((message) => {
|
messages = messages.map((message) => {
|
||||||
message.done = true;
|
message.done = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue