Merge pull request #30 from PR0M3TH3AN/fix-dashboard-refresh-counter-8604339066088703650

Fix dashboard refresh resetting filters and relay counter leak
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-14 00:32:10 -05:00
commit 26cf04f092
2 files changed
+15 -3

No files matched your search

+12 -3
View File
@@ -630,7 +630,14 @@
});
ws.addEventListener('close', () => {
// Clean up socket from tracking array
const idx = sockets.indexOf(ws);
if (idx !== -1) {
sockets.splice(idx, 1);
}
if (isTeardown) return;
if (ws.isManualClose) return;
connectedCount = Math.max(0, connectedCount - 1);
updateConnectionBadge();
@@ -668,6 +675,7 @@
// Close existing connections and reconnect
for (const ws of sockets) {
try {
ws.isManualClose = true;
ws.close();
} catch {
// ignore
@@ -686,9 +694,6 @@
function init() {
if (!isAlive()) return;
cadenceFilter.value = DASHBOARD_CONFIG.defaultCadenceView;
statusFilter.value = DASHBOARD_CONFIG.defaultStatusView;
applyConfigToHelpText();
for (const url of RELAYS) {
@@ -702,6 +707,10 @@
RELAYS = DASHBOARD_CONFIG.relays;
D_TAG_PREFIX = `${DASHBOARD_CONFIG.namespace}-lock/`;
HASHTAG = DASHBOARD_CONFIG.hashtag;
cadenceFilter.value = DASHBOARD_CONFIG.defaultCadenceView;
statusFilter.value = DASHBOARD_CONFIG.defaultStatusView;
init();
}
+3
View File
@@ -0,0 +1,3 @@
127.0.0.1 - - [14/Feb/2026 05:24:39] "GET /dashboard/index.html HTTP/1.1" 200 -
127.0.0.1 - - [14/Feb/2026 05:24:39] "GET /dashboard/styles.css HTTP/1.1" 200 -
127.0.0.1 - - [14/Feb/2026 05:24:40] "GET /torch-config.json HTTP/1.1" 200 -