From 0c3ef3d07e124b6594ced3d2bb5dd75d748cda12 Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Mon, 13 Apr 2026 15:30:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=80=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/style.css | 29 +++++++++++++++++++++++++++++ public/js/app.js | 21 +++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/public/css/style.css b/public/css/style.css index 9748e43..b7020a4 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -328,6 +328,35 @@ body { transform: rotate(30deg); } +/* ---- Global Refresh Button ---- */ +.btn-refresh-global { + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + background: var(--bg-card); + border: 1px solid var(--border-color); + border-radius: var(--radius-sm); + color: var(--text-secondary); + cursor: pointer; + transition: all 0.25s ease; + margin-left: 4px; + padding: 0; +} + +.btn-refresh-global:hover { + border-color: var(--border-hover); + color: var(--accent-emerald); + background: rgba(16, 185, 129, 0.08); + transform: translateY(-1px); +} + +.btn-refresh-global svg { + width: 16px; + height: 16px; +} + /* ---- Theme Switch ---- */ .theme-switch-wrapper { display: flex; diff --git a/public/js/app.js b/public/js/app.js index 670dfa8..d8a4fd9 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -803,9 +803,30 @@
${escapeHtml(username)} +
`; document.getElementById('btnLogout').addEventListener('click', handleLogout); + document.getElementById('btnGlobalRefresh').addEventListener('click', async () => { + const btn = document.getElementById('btnGlobalRefresh'); + const icon = btn.querySelector('svg'); + if (icon) icon.style.animation = 'spin 0.8s ease-in-out'; + + await Promise.all([ + fetchNetworkHistory(true), + fetchMetrics(true) + ]); + + if (icon) { + setTimeout(() => { + icon.style.animation = ''; + }, 800); + } + }); } else { user = null; dom.btnSettings.style.display = 'none';