mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-11-06 09:17:31 +00:00
style(webui): dashboard.js 格式化(换行与引号风格)
编辑器/格式化器在保存时改的,只动换行与引号,无语义变化: · 一行多条件的 if 拆成多行 · 含双引号的字符串改用双引号包裹(避免转义) · 长字符串拼接拆分 13 insertions / 4 deletions,逐行核过无逻辑改动。
This commit is contained in:
@ -2396,7 +2396,11 @@ function renderChat() {
|
|||||||
"error",
|
"error",
|
||||||
(e) => {
|
(e) => {
|
||||||
var t = e.target;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
var box = t.parentElement;
|
var box = t.parentElement;
|
||||||
@ -2508,7 +2512,7 @@ function renderChat() {
|
|||||||
escHtml(att.url) +
|
escHtml(att.url) +
|
||||||
'" ' +
|
'" ' +
|
||||||
'alt="image" loading="lazy" style="max-width:320px;max-height:240px;border-radius:10px;display:block;cursor:zoom-in" ' +
|
'alt="image" loading="lazy" style="max-width:320px;max-height:240px;border-radius:10px;display:block;cursor:zoom-in" ' +
|
||||||
'/></a>';
|
"/></a>";
|
||||||
} else if (att.type === "audio") {
|
} else if (att.type === "audio") {
|
||||||
// 音频用原生播放器:与图片同理,附件能在聊天里直接消费才算可见。
|
// 音频用原生播放器:与图片同理,附件能在聊天里直接消费才算可见。
|
||||||
// preload="metadata" 只拉时长不拉全部字节,避免历史消息满屏时并发下载。
|
// preload="metadata" 只拉时长不拉全部字节,避免历史消息满屏时并发下载。
|
||||||
@ -4221,7 +4225,11 @@ async function queryMemoryContext() {
|
|||||||
var score = Number(d.score || 0).toFixed(2);
|
var score = Number(d.score || 0).toFixed(2);
|
||||||
return (
|
return (
|
||||||
'<div style="margin-bottom:4px">' +
|
'<div style="margin-bottom:4px">' +
|
||||||
'<span style="opacity:.7">' + escHtml(when) + " · " + score + "</span> " +
|
'<span style="opacity:.7">' +
|
||||||
|
escHtml(when) +
|
||||||
|
" · " +
|
||||||
|
score +
|
||||||
|
"</span> " +
|
||||||
escHtml(d.text || "") +
|
escHtml(d.text || "") +
|
||||||
"</div>"
|
"</div>"
|
||||||
);
|
);
|
||||||
@ -5101,7 +5109,8 @@ function renderCmdHistory() {
|
|||||||
var badge = ok ? "badge-green" : "badge-red";
|
var badge = ok ? "badge-green" : "badge-red";
|
||||||
var label = ok
|
var label = ok
|
||||||
? __("成功", "OK")
|
? __("成功", "OK")
|
||||||
: __("失败", "Failed") + (c.exit_code ? " (" + c.exit_code + ")" : "");
|
: __("失败", "Failed") +
|
||||||
|
(c.exit_code ? " (" + c.exit_code + ")" : "");
|
||||||
html +=
|
html +=
|
||||||
"<tr>" +
|
"<tr>" +
|
||||||
'<td style="font-family:monospace;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">' +
|
'<td style="font-family:monospace;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">' +
|
||||||
|
|||||||
Reference in New Issue
Block a user