feat: click status indicator to force reconnect
This commit is contained in:
@@ -3,6 +3,14 @@ const Topbar = {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._statusEl = document.getElementById('connection-status');
|
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) => {
|
WS.on('status', (status) => {
|
||||||
this._statusEl.className = `status-indicator ${status}`;
|
this._statusEl.className = `status-indicator ${status}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user