Dawnline 0.4.2
Build packages / Version (push) Waiting to run

- Connections show up at once: the agent looks at the tunnels every
  second and, the moment a device connects or roams, writes it to the
  activity log, updates traffic and the map, and locates the new address
- A device counts as gone when its WireGuard session expires (1-3 min
  after it leaves), so a phone asleep no longer flaps between
  disconnect and connect
- The admin pages follow along within seconds: Overview, People, the
  person page and the device panel refresh when something happens, with
  a light check every 2 s instead of reloading everything every 10 s
- The personal portal no longer refreshes itself in the background:
  every request costs the router a CGI process, so it loads once and
  after the visitor's own changes
- Agent guidance and code standards (backend, frontend, shell, UI) now
  live in the repository: AGENTS.md and rules/
This commit is contained in:
Aemeath committed 2026-10-16 03:52:21 +03:00
1 parent 6444722d14
commit 29b1d7dfd7
26 files changed
+419 -104

No files matched your search

+5 -13
View File
@@ -75,7 +75,6 @@ const base = app.dataset.base ?? '';
const pageTitle = app.dataset.title || 'Dawnline';
const isMobile = () => window.matchMedia('(max-width: 959px)').matches || /Android|iPhone|iPad/.test(navigator.userAgent);
let state: State | null = null;
let pollTimer = 0;
/** The personal link is the key: its path is the code (no sessions). */
const code = /^\/[a-z]{6}-[a-z]{6}-[a-z]{6}$/.test(base) ? base.slice(1) : '';
@@ -1098,20 +1097,13 @@ async function refresh() {
state = null;
linkGone();
}
// A network hiccup: keep showing the last state and try again on the next poll.
// A network hiccup: keep showing the last state (the page loads fresh data on reload).
else if (!state) shell(h('div', { class: 'card' }, h('p', {}, er.message)));
}
}
function startPolling() {
clearInterval(pollTimer);
pollTimer = window.setInterval(() => {
if (state && document.visibilityState === 'visible') void refresh();
}, 15000);
}
// No periodic refresh: every portal request runs a CGI process on the router.
// The page reloads its data after the visitor's own changes and while it waits
// for a new device's first connection.
if (!base || !code) linkGone();
else {
void refresh();
startPolling();
}
else void refresh();