Merge pull request #5556 from open-webui/dev

refac
This commit is contained in:
Timothy Jaeryang Baek 2024-09-20 15:44:31 +02:00 committed by GitHub
commit 5fe2795db8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 15 deletions

View File

@ -23,6 +23,8 @@
export let history;
let selectedMessageId = null;
const nodes = writable([]);
const edges = writable([]);
@ -34,10 +36,17 @@
drawFlow();
}
$: if (history?.currentId) {
fitView({ nodes: [{ id: history.currentId }] });
$: if (history && history.currentId) {
focusNode();
selectedMessageId = null;
}
const focusNode = async () => {
if (selectedMessageId === null) {
await fitView({ nodes: [{ id: history.currentId }] });
}
};
const drawFlow = async () => {
const nodeList = [];
const edgeList = [];
@ -168,6 +177,8 @@
on:nodeclick={(e) => {
console.log(e.detail.node.data);
dispatch('nodeclick', e.detail);
selectedMessageId = e.detail.node.data.message.id;
fitView({ nodes: [{ id: selectedMessageId }] });
}}
/>
{/if}

View File

@ -73,10 +73,10 @@
"AUTOMATIC1111 Api Auth String": "AUTOMATIC1111 Api 鉴权字符串",
"AUTOMATIC1111 Base URL": "AUTOMATIC1111 基础地址",
"AUTOMATIC1111 Base URL is required.": "需要 AUTOMATIC1111 基础地址。",
"Available list": "",
"Available list": "可用列表",
"available!": "版本可用!",
"Azure AI Speech": "",
"Azure Region": "",
"Azure AI Speech": "Azure AI Speech",
"Azure Region": "Azure Region",
"Back": "返回",
"Bad Response": "点踩此回答",
"Banners": "公告横幅",
@ -97,7 +97,7 @@
"Chat Bubble UI": "气泡样式对话",
"Chat Controls": "对话高级设置",
"Chat direction": "对话样式方向",
"Chat Overview": "",
"Chat Overview": "对话概述",
"Chats": "对话",
"Check Again": "刷新重试",
"Check for updates": "检查更新",
@ -415,8 +415,8 @@
"Model {{modelId}} not found": "未找到模型 {{modelId}}",
"Model {{modelName}} is not vision capable": "模型 {{modelName}} 不支持视觉能力",
"Model {{name}} is now {{status}}": "模型 {{name}} 现在是 {{status}}",
"Model {{name}} is now at the top": "",
"Model accepts image inputs": "",
"Model {{name}} is now at the top": "模型 {{name}} 已移动到顶部",
"Model accepts image inputs": "模型接受图像输入",
"Model created successfully!": "模型创建成功!",
"Model filesystem path detected. Model shortname is required for update, cannot continue.": "检测到模型文件系统路径,无法继续进行。更新操作需要提供模型简称。",
"Model ID": "模型 ID",
@ -428,7 +428,7 @@
"Modelfile Content": "模型文件内容",
"Models": "模型",
"More": "更多",
"Move to Top": "",
"Move to Top": "移动到顶部",
"Name": "名称",
"Name Tag": "标签",
"Name your model": "为您的模型命名",
@ -474,8 +474,8 @@
"OpenAI URL/Key required.": "需要 OpenAI URL/Key",
"or": "或",
"Other": "其他",
"Output format": "",
"Overview": "",
"Output format": "输出格式",
"Overview": "概述",
"Password": "密码",
"PDF document (.pdf)": "PDF 文档 (.pdf)",
"PDF Extract Images (OCR)": "PDF 图像处理 (使用 OCR)",
@ -538,7 +538,7 @@
"Save": "保存",
"Save & Create": "保存并创建",
"Save & Update": "保存并更新",
"Save As Copy": "",
"Save As Copy": "另存为副本",
"Save Tag": "保存标签",
"Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through": "我们不再支持将聊天记录直接保存到浏览器的存储空间。请点击下面的按钮下载并删除您的聊天记录。别担心,您可以轻松地将聊天记录重新导入到后台。",
"Scan": "立即扫描",
@ -580,7 +580,7 @@
"Send": "发送",
"Send a Message": "输入消息",
"Send message": "发送消息",
"Sends `stream_options: { include_usage: true }` in the request.\nSupported providers will return token usage information in the response when set.": "",
"Sends `stream_options: { include_usage: true }` in the request.\nSupported providers will return token usage information in the response when set.": "在请求中发送 `stream_options: { include_usage: true }`。\n设置后支持的接口将在返回响应中包含令牌使用信息。",
"September": "九月",
"Serper API Key": "Serper API 密钥",
"Serply API Key": "Serply API 密钥",
@ -616,9 +616,9 @@
"Source": "来源",
"Speech recognition error: {{error}}": "语音识别错误:{{error}}",
"Speech-to-Text Engine": "语音转文本引擎",
"Speed Rate": "",
"Speed Rate": "速率",
"Stop Sequence": "停止序列 (Stop Sequence)",
"Stream Chat Response": "",
"Stream Chat Response": "以流式返回对话响应",
"STT Model": "语音转文本模型",
"STT Settings": "语音转文本设置",
"Submit": "提交",