feat: click status indicator to force reconnect

This commit is contained in:
2026-07-27 19:40:50 +08:00
parent 5bc2c18f06
commit 5cea0f9851
+8
View File
@@ -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}`;