badges on the right, evolution api sender

This commit is contained in:
Lucas Tettamanti
2026-01-26 01:21:08 -03:00
parent e85afab3e6
commit 53293ce9b3
13 changed files with 422 additions and 51 deletions

View File

@@ -183,6 +183,12 @@ class OpsShell extends HTMLElement {
this.setView("takeovers", {}, { updateUrl: true });
};
// Listen for new takeovers via SSE - update badge immediately
this._unsubTakeover = on("takeover:created", () => {
this._takeoverCount++;
this.updateTakeoverBadge(this._takeoverCount);
});
// Start polling for takeovers
this.pollTakeovers();
this._pollInterval = setInterval(() => this.pollTakeovers(), 30000);
@@ -192,6 +198,7 @@ class OpsShell extends HTMLElement {
this._unsub?.();
this._unsubSwitch?.();
this._unsubRouter?.();
this._unsubTakeover?.();
if (this._pollInterval) clearInterval(this._pollInterval);
}