From d4de5becdec6378aac95920c97cd80176a2d6423 Mon Sep 17 00:00:00 2001 From: JianFeeeee <109188060+JianFeeeee@users.noreply.github.com> Date: Mon, 24 Aug 2026 21:01:06 +0800 Subject: [PATCH] =?UTF-8?q?chore(webui):=20=E6=B8=85=E7=90=86=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=AD=BB=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 8 个未引用 JS 函数: confirmDialog/showToast/timeAgo/statCard/ systemTheme/getStarmapBg/resetStarmapCamera/toggleStarmapAuto (实际使用的是 toast()/内联卡片构建/setTheme) - 删除星图 hover info 空转块(starmap-info 容器不存在,infoEl 永远 null, sm-info-name/type/mentions/links 子元素查询全部无效) - 删除死 CSS: #starmap-container/#starmap-stats/#starmap-info/ #starmap-loading/.starmap-toggle(对应 HTML 元素已不存在) - 删除重复的 #sm-container-chat height:480px(被后续 260px 覆盖) 共 -266 行,JS/CSS 语法验证通过 --- internal/plugins/webui/dashboard.html | 266 -------------------------- 1 file changed, 266 deletions(-) diff --git a/internal/plugins/webui/dashboard.html b/internal/plugins/webui/dashboard.html index 246e67d3..dc4aebd7 100644 --- a/internal/plugins/webui/dashboard.html +++ b/internal/plugins/webui/dashboard.html @@ -1745,9 +1745,6 @@ background: flex-shrink: 0; margin-bottom: 0; } - #sm-container-chat { - height: 480px; - } .loading { display: inline-block; width: 16px; @@ -1856,119 +1853,6 @@ background: transform: translateY(0); } } - #starmap-container { - width: 100%; - height: calc(100vh - 100px); - position: relative; - overflow: hidden; - border-radius: var(--radius-md); - border: 1px solid var(--border-color); - background: var(--bg-input); - } - #starmap-container canvas { - display: block; - } - #starmap-stats { - position: absolute; - top: 16px; - left: 16px; - background: var(--glass-bg-strong); - padding: 12px 16px; - border-radius: var(--radius-md); - border: 1px solid var(--glass-border); - font-size: 13px; - z-index: 10; - backdrop-filter: blur(12px); - -webkit-backdrop-filter: blur(12px); - color: var(--text-secondary); - box-shadow: var(--shadow-md); - } - #starmap-stats h3 { - margin-bottom: 6px; - color: var(--accent); - font-size: 14px; - } - #starmap-stats p { - margin: 2px 0; - color: var(--text-muted); - font-size: 12px; - } - #starmap-stats span { - color: var(--text-primary); - font-weight: 700; - } - #starmap-info { - position: absolute; - top: 16px; - right: 16px; - background: var(--glass-bg-strong); - padding: 12px 16px; - border-radius: var(--radius-md); - border: 1px solid var(--glass-border); - font-size: 13px; - z-index: 10; - display: none; - backdrop-filter: blur(12px); - -webkit-backdrop-filter: blur(12px); - color: var(--text-secondary); - max-width: 260px; - box-shadow: var(--shadow-md); - } - #starmap-info h3 { - color: var(--success); - margin-bottom: 6px; - font-size: 14px; - } - #starmap-info p { - margin: 2px 0; - color: var(--text-muted); - font-size: 12px; - } - #starmap-info .label { - color: var(--text-muted); - } - #starmap-loading { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 18px; - color: var(--accent); - z-index: 20; - } - .starmap-toggle { - position: absolute; - bottom: 16px; - left: 50%; - transform: translateX(-50%); - display: flex; - gap: 8px; - z-index: 10; - } - .starmap-toggle button { - background: var(--glass-bg-strong); - border: 1px solid var(--glass-border); - color: var(--text-secondary); - padding: 6px 14px; - border-radius: var(--radius-pill); - cursor: pointer; - font-size: 12px; - font-family: inherit; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - transition: all 0.2s; - } - .starmap-toggle button:hover { - background: var(--accent-bg); - color: var(--text-primary); - border-color: rgba(255, 127, 172, 0.5); - } - .starmap-toggle button.on { - background: var(--accent-bg); - color: var(--accent); - border-color: var(--accent); - box-shadow: var(--shadow-glow); - } #sm-container-chat { height: 260px; background: var(--bg-input); @@ -2140,22 +2024,6 @@ background: .kv-row .key { width: auto; } - #starmap-stats { - top: 8px; - left: 8px; - padding: 8px 10px; - font-size: 11px; - } - #starmap-info { - top: 8px; - right: 8px; - padding: 8px 10px; - max-width: 180px; - font-size: 11px; - } - #starmap-container { - height: calc(100vh - 60px); - } .msg-avatar { width: 24px; height: 24px; @@ -2393,11 +2261,6 @@ background: var ICON_MOON = ''; - function systemTheme() { - return window.matchMedia("(prefers-color-scheme: dark)").matches - ? "dark" - : "light"; - } function setTheme(name) { document.documentElement.setAttribute("data-theme", name); @@ -2539,13 +2402,6 @@ background: .replace(/"/g, """); } - function timeAgo(t) { - var s = Math.floor((Date.now() - new Date(t).getTime()) / 1000); - if (s < 60) return s + "秒前"; - var m = Math.floor(s / 60); - if (m < 60) return m + "分钟前"; - return Math.floor(m / 60) + "小时前"; - } function toast(m, isError) { var t = document.getElementById("toast"); @@ -2559,74 +2415,7 @@ background: } // ===== 8.6 Unified toast + confirm dialog ===== - function showToast(type, msg) { - var cls = "toast"; - if (type === "success") cls += " success"; - else if (type === "error") cls += " error"; - else if (type === "warn") cls += " warn"; - var t = document.getElementById("toast"); - t.textContent = msg; - t.className = cls; - t.style.display = "block"; - t.style.animation = "none"; - void t.offsetWidth; - t.style.animation = ""; - clearTimeout(t._hideTimer); - t._hideTimer = setTimeout(function () { - t.style.display = "none"; - }, 3000); - } - function confirmDialog(action, onConfirm) { - var existing = document.getElementById("confirm-overlay"); - if (existing) existing.remove(); - var o = document.createElement("div"); - o.id = "confirm-overlay"; - o.className = "confirm-overlay"; - o.innerHTML = - '
" + - escHtml(action) + - "
" + - '