From f122b1709744fdefce781a6c9c40af7023fad20d Mon Sep 17 00:00:00 2001 From: exynos <110159911+xiaoxi68@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:15:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(update):=20=E5=8F=96=E6=B6=88=20WebUI=20?= =?UTF-8?q?=E4=B8=8E=E6=A0=B8=E5=BF=83=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=EF=BC=8C=E6=B6=88=E9=99=A4=E2=80=9Cwebui=E6=9C=89=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC!=E2=80=9D=E7=9A=84=E8=AF=AF=E6=8A=A5=20(#310?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(update): 取消 WebUI 与核心版本对比,消除“webui有新版本!”的误报 不再比较 dv 与核心版本 * fix(update): 保留dv逻辑,新增installed标识以避免误报 新增安装状态布尔值,保留“dv 是否存在”的信息 * Fix dashboard version update check logic --------- Co-authored-by: LIghtJUNction --- astrbot/dashboard/routes/update.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/astrbot/dashboard/routes/update.py b/astrbot/dashboard/routes/update.py index dca356781..e94065b02 100644 --- a/astrbot/dashboard/routes/update.py +++ b/astrbot/dashboard/routes/update.py @@ -52,10 +52,15 @@ class UpdateRoute(Route): try: dv = await get_dashboard_version() + # WebUI 版本独立于核心版本:不再用 dv 与 v{VERSION} 比较,避免误报 if type_ == "dashboard": return ( Response() - .ok({"has_new_version": dv != f"v{VERSION}", "current_version": dv}) + .ok({ + "has_new_version": False, + "current_version": dv, + "installed": bool(dv), + }) .__dict__ ) else: @@ -67,7 +72,8 @@ class UpdateRoute(Route): "version": f"v{VERSION}", "has_new_version": ret is not None, "dashboard_version": dv, - "dashboard_has_new_version": dv and dv != f"v{VERSION}", + # dv正常获取则不会提示需要更新 + "dashboard_has_new_version": not bool(dv), }, ).__dict__ except Exception as e: