From 0de69a6345e0d459aaf0c46f67bda1e751006011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Thu, 30 Apr 2026 10:43:23 +0800 Subject: [PATCH] Add files via upload --- web/static/js/dashboard.js | 2 +- web/static/js/notifications.js | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/web/static/js/dashboard.js b/web/static/js/dashboard.js index 0ff94f97..a312cce5 100644 --- a/web/static/js/dashboard.js +++ b/web/static/js/dashboard.js @@ -730,7 +730,7 @@ function renderRecommendedActions(state) { if (state.openCriticalCount > 0) { actions.push({ level: 'urgent', - icon: '', + icon: '', title: dt('dashboard.recoFixCritical', { count: state.openCriticalCount }, '修复 ' + state.openCriticalCount + ' 个待处理严重漏洞'), desc: dt('dashboard.recoFixCriticalDesc', null, '严重等级的漏洞应优先处置'), diff --git a/web/static/js/notifications.js b/web/static/js/notifications.js index 68886c0b..5c49b302 100644 --- a/web/static/js/notifications.js +++ b/web/static/js/notifications.js @@ -287,10 +287,18 @@ closeDropdown(); return; } - dropdown.style.display = 'block'; - bellBtn.classList.add('active'); - state.dropdownOpen = true; - await refreshNotifications(); + // 从仪表盘「查看全部」等容器外入口打开时,同一 click 会冒泡到 document, + // handleDocumentClick 会误判为「点在外面」并立刻关掉。推迟到宏任务再展开即可。 + const runOpen = async function () { + if (dropdown.style.display !== 'none') return; + dropdown.style.display = 'block'; + bellBtn.classList.add('active'); + state.dropdownOpen = true; + await refreshNotifications(); + }; + window.setTimeout(function () { + void runOpen(); + }, 0); } async function markAllSeen() {