From 5cea0f9851cfb0d7114d51d2e6b11dbf2a8a4cb0 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Mon, 27 Jul 2026 19:40:50 +0800 Subject: [PATCH] feat: click status indicator to force reconnect --- static/js/components/topbar.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/js/components/topbar.js b/static/js/components/topbar.js index 63ffd45..ae427e5 100644 --- a/static/js/components/topbar.js +++ b/static/js/components/topbar.js @@ -3,6 +3,14 @@ const Topbar = { init() { this._statusEl = document.getElementById('connection-status'); + this._statusEl.style.cursor = 'pointer'; + this._statusEl.addEventListener('click', () => { + if (!WS.connected) { + WS._reconnectDelay = 500; + WS._connect(); + Toast.show('正在重连...', 'info', 1500); + } + }); WS.on('status', (status) => { this._statusEl.className = `status-indicator ${status}`;