Hub (FastAPI + no-build web UI): - Network health: live probe/target matrix, status strips, incidents - Probes: add (with install command), rename, remove, latency and throughput charts - Clients merged from AdGuard, DHCP, query log and probe ARP tables; names, categories, suspicious flag, notes, per-client DNS requests - Query log, domain detail (clients, related subdomains), blocked domains via the AdGuard Home /control API Probe: tests peers (ping, HTTP, throughput), gateway, LAN and public DNS, internet URLs and an optional VPS; buffers results while the hub is down. Gateway and ARP from /proc/net on Linux, route/arp on macOS. Install: install.sh (hub) and install-probe.sh (generated from it), each in docker mode (compose; default on Linux hosts) or native mode (venv + systemd or launchd; default on macOS and in LXC). Both modes deploy with an update command that checks the new commit and rolls back on failure. CLAUDE.md carries shared context for Claude Code sessions on each machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
2 KiB
JavaScript
38 lines
2 KiB
JavaScript
// Plain ES modules, no bundler.
|
|
import { startShell } from './shell.js';
|
|
import { get } from './api.js';
|
|
|
|
let offline = 0;
|
|
|
|
startShell({
|
|
name: 'network monitor',
|
|
categories: ['Network', 'DNS', 'Hub'],
|
|
views: [
|
|
{ id: 'health', name: 'Network health', path: '/', category: 'Network', icon: '◎',
|
|
description: 'Mesh and internet health as the probes see it: now, over time, and every outage.', load: () => import('./views/health.js') },
|
|
{ id: 'probes', name: 'Probes', path: '/probes', category: 'Network', icon: 'P',
|
|
description: 'Add, place and remove the machines that test the network.', load: () => import('./views/probes.js'),
|
|
badge: () => offline },
|
|
{ id: 'clients', name: 'Clients', path: '/clients', category: 'DNS', icon: '▣',
|
|
description: 'Every device seen on the network, with your names, categories and flags.', load: () => import('./views/clients.js') },
|
|
{ id: 'queries', name: 'Query log', path: '/queries', category: 'DNS', icon: 'Q?',
|
|
description: 'Sift through DNS requests from AdGuard Home.', load: () => import('./views/queries.js') },
|
|
{ id: 'domains', name: 'Domains', path: '/domains', category: 'DNS', icon: '.com',
|
|
description: 'Most requested domains, and who asks for each one.', load: () => import('./views/domains.js') },
|
|
{ id: 'blocked', name: 'Blocked domains', path: '/blocked', category: 'DNS', icon: '⊘',
|
|
description: 'What AdGuard Home blocked, how often, and for whom.', load: () => import('./views/blocked.js') },
|
|
{ id: 'settings', name: 'Settings', path: '/settings', category: 'Hub', icon: '⚙',
|
|
description: 'What the hub tests, its thresholds and its AdGuard connection.', load: () => import('./views/settings.js') },
|
|
],
|
|
});
|
|
|
|
// Offline probes show as a count on the Probes nav item.
|
|
async function pollProbes() {
|
|
try {
|
|
const { probes } = await get('/api/probes');
|
|
offline = probes.filter((p) => !p.online).length;
|
|
window.dispatchEvent(new Event('app:badges'));
|
|
} catch {}
|
|
}
|
|
pollProbes();
|
|
setInterval(pollProbes, 60000);
|