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}`;