From cc07adb20bddeca3bf746718c6aee69802426a6c Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Sat, 31 Oct 2026 16:20:47 +0800 Subject: [PATCH] =?UTF-8?q?style(webui):=20dashboard.js=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=EF=BC=88=E6=8D=A2=E8=A1=8C=E4=B8=8E=E5=BC=95?= =?UTF-8?q?=E5=8F=B7=E9=A3=8E=E6=A0=BC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 编辑器/格式化器在保存时改的,只动换行与引号,无语义变化: · 一行多条件的 if 拆成多行 · 含双引号的字符串改用双引号包裹(避免转义) · 长字符串拼接拆分 13 insertions / 4 deletions,逐行核过无逻辑改动。 --- internal/plugins/webui/dashboard.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/internal/plugins/webui/dashboard.js b/internal/plugins/webui/dashboard.js index 98120576..d1a91fb1 100644 --- a/internal/plugins/webui/dashboard.js +++ b/internal/plugins/webui/dashboard.js @@ -2396,7 +2396,11 @@ function renderChat() { "error", (e) => { var t = e.target; - if (!t || t.tagName !== "IMG" || !t.classList.contains("chat-attachment-img")) { + if ( + !t || + t.tagName !== "IMG" || + !t.classList.contains("chat-attachment-img") + ) { return; } var box = t.parentElement; @@ -2508,7 +2512,7 @@ function renderChat() { escHtml(att.url) + '" ' + 'alt="image" loading="lazy" style="max-width:320px;max-height:240px;border-radius:10px;display:block;cursor:zoom-in" ' + - '/>'; + "/>"; } else if (att.type === "audio") { // 音频用原生播放器:与图片同理,附件能在聊天里直接消费才算可见。 // preload="metadata" 只拉时长不拉全部字节,避免历史消息满屏时并发下载。 @@ -4221,7 +4225,11 @@ async function queryMemoryContext() { var score = Number(d.score || 0).toFixed(2); return ( '
' + - '' + escHtml(when) + " · " + score + " " + + '' + + escHtml(when) + + " · " + + score + + " " + escHtml(d.text || "") + "
" ); @@ -5101,7 +5109,8 @@ function renderCmdHistory() { var badge = ok ? "badge-green" : "badge-red"; var label = ok ? __("成功", "OK") - : __("失败", "Failed") + (c.exit_code ? " (" + c.exit_code + ")" : ""); + : __("失败", "Failed") + + (c.exit_code ? " (" + c.exit_code + ")" : ""); html += "" + '' +