diff --git a/README.md b/README.md
index ebec010..b4ef7ca 100644
--- a/README.md
+++ b/README.md
@@ -106,17 +106,30 @@ Ping-only (no node_exporter): **pbs** (10.10.10.3)
## Pages
### Dashboard (`/`)
+- **Needs attention** at the top gathers what every page would flag into two lists, each line linking to
+ where it is fixed:
+ - *Broken now*: active alerts (one line, with the devices), an outlet that is off but feeds a device,
+ frozen outlet readings, and cables not where the cutsheet says.
+ - *Tidy up*: UniFi port names pointing at the wrong device or at an empty port, live links not on the
+ cutsheet, labels to print, powered outlets with no device assigned, and rack items that overlap or sit
+ outside the rack.
+
+ Served by `GET /api/attention` (`attention.py`) and refreshed with the rest of the page.
- Device search (see Device pages below)
-- Active alerts first, then the WAN / Fiber panel, hosts, UniFi devices, and recently resolved alerts
-- Real-time host status grid with per-NIC link state (UP / DOWN / degraded)
-- WAN / Fiber panel: WAN and PON state, Rx/Tx power, optics temperature, throughput, errors, gateway uptime and last restart, 7-day Rx trend, recent WAN outages
-- UniFi device table (switches, APs, gateway)
- Active alerts table with severity, target, consecutive failures, ticket link
+- WAN / Fiber panel: WAN and PON state, Rx/Tx power, optics temperature, throughput, errors, gateway uptime and last restart, 7-day Rx trend, recent WAN outages
+- Hosts with per-NIC link state; NICs marked unused fold into a "+N unused" line
+- UniFi devices as a compact list (name and model; offline ones turn red with a suppress button)
+- Recently resolved alerts, folded until opened
- Follow-up flags (see Follow-up below): a โณ badge on alerts active for days, a "ticket closed" badge when the
ticket was closed but the alert is still active, and a Needs Follow-up panel of tickets left open after their
alert cleared. A "TO FOLLOW UP" chip in the status bar counts them all.
-- Quick-suppress modal: apply timed or manual suppression from any alert row
-- Auto-refreshes every 30 seconds via `/api/status` + `/api/network`
+- Quick-suppress modal: apply timed or manual suppression from any alert row or host card
+- Auto-refreshes every 30 seconds via `/api/status` + `/api/network` + `/api/attention`
+
+The header spells out the name; the navigation keeps Dashboard, Topology, Rack and Cutsheet in view, with
+Alert history and Suppressions under **More** (and in the command palette, Ctrl+K). On a phone the drawer
+holds every page and Start maintenance.
### Alert history (`/events`)
Every alert Gandalf raised in the last 24 hours to 90 days, including ones that cleared before anyone
@@ -185,9 +198,11 @@ The rack front, drawn from the rack units set on cutsheet items, top first.
The whole network as the switches see it now, top down: the internet, the modem, the gateway, then
each switch by how many hops it is from the gateway, the gear and unknown devices below them, and the
servers along the bottom. Power gear (PDU, UPS, power strip) sits in a rail on the right.
-- **What needs a look** is listed above the diagram: devices down, degraded or with active alerts,
- cables down or last seen elsewhere, ports named after the wrong device, and cables with errors.
- Click one to jump to it. With nothing to report it says all clear. Problem cables are drawn in full
+- **What needs a look** sits above the diagram as one line ("7 to look at" and the first two):
+ devices down, degraded or with active alerts, cables down or last seen elsewhere, ports named after
+ the wrong device, and cables with errors. Open it to list them all and click one to jump to it; it
+ remembers whether it was open. With nothing to report it says all clear. The how-to hides behind the
+ **?** next to the page intro. Problem cables are drawn in full
colour with a glow and always shown, whatever the filters; healthy cables are drawn quietly.
- **A card per device**, all the same height so the whole network reads at a glance: name, state
(coloured edge and dot), and a picture: UniFi gear shows its real faceplate (the same drawings as the
@@ -339,8 +354,13 @@ entry in `FACEPLATES`.
Where every cable is meant to go, checked against what Gandalf actually sees. Anyone who can log in
can view it; only the `admin` group can edit, and every change is logged with who made it and when.
+The page has five tabs, each with its count: **Cables**, **To do** (undocumented links, port names
+in UniFi, labels to make), **Patch panels**, **Inventory** and **History**. A link to a section, cable
+or item (`/cutsheet#cable-7`, `#cs-portnames-section`) opens the tab that holds it, and
+`/cutsheet?problems=1` opens the cables with problems. Printing prints every tab.
+
- **Inventory**: things discovery can't see: patch panels, wall jacks, shelves, and rack positions
- for devices (use a device's exact Gandalf name). Panels and jacks are passive: a cable on a
+ for devices (use a device's exact Gandalf name). The rack page draws them. Panels and jacks are passive: a cable on a
port's front continues through the same port's rear.
- **Cables**: two endpoints each (device or item, port, and front/rear for panels and jacks), plus
ID, type, length, color, status (`planned`, `installed`, `dark`, `retired`) and notes. Leave the
diff --git a/static/app.js b/static/app.js
index 34c606e..86a6fe1 100644
--- a/static/app.js
+++ b/static/app.js
@@ -140,16 +140,6 @@ function updateStatusBar(summary, lastCheck, daemonOk, followUps = 0, hasStaleTi
alertBadge.style.display = total ? '' : 'none';
}
- // Update stat cards
- const scCrit = document.getElementById('stat-critical-val');
- const scWarn = document.getElementById('stat-warning-val');
- const scRes = document.getElementById('stat-resolved-val');
- if (scCrit) scCrit.textContent = critCount;
- if (scWarn) scWarn.textContent = warnCount;
- if (scRes && summary.resolved_24h !== null && summary.resolved_24h !== undefined) scRes.textContent = summary.resolved_24h;
- const statCritCard = document.getElementById('stat-critical');
- if (statCritCard) statCritCard.classList.toggle('lt-stat-card--alert', critCount > 0);
-
// Stale data banner: warn if last_check is older than 15 minutes
let staleBanner = document.getElementById('stale-banner');
if (lastCheck) {
@@ -173,9 +163,6 @@ function updateStatusBar(summary, lastCheck, daemonOk, followUps = 0, hasStaleTi
}
function updateHostGrid(hosts) {
- const scHosts = document.getElementById('stat-hosts-val');
- if (scHosts) scHosts.textContent = Object.keys(hosts).length;
-
for (const [name, host] of Object.entries(hosts)) {
const card = document.querySelector(`.host-card[data-host="${CSS.escape(name)}"]`);
if (!card) continue;
@@ -188,15 +175,17 @@ function updateHostGrid(hosts) {
const ifaceList = card.querySelector('.iface-list');
if (ifaceList && host.interfaces && Object.keys(host.interfaces).length > 0) {
- ifaceList.innerHTML = Object.entries(host.interfaces)
- .sort(([a], [b]) => a.localeCompare(b))
- .map(([iface, state]) => `
+ // NICs marked unused fold into one line, so the card shows what is cabled
+ const all = Object.entries(host.interfaces).sort(([a], [b]) => a.localeCompare(b));
+ const inUse = all.filter(([, state]) => state !== 'unused');
+ const unused = all.length - inUse.length;
+ ifaceList.innerHTML = inUse.map(([iface, state]) => `
{% for e in recent_resolved %}
{%- set dot_cls = 'lt-timeline-item--green' if e.severity == 'info' else 'lt-timeline-item--dim' -%}
@@ -369,7 +292,7 @@
The rack front, drawn from the rack units on the cutsheet with live port state. Hover a port to light up every port on the same cable run; click it to open the port or the cable.
+
The rack, drawn from the cutsheet with live port state.
+ ?Hover a port to light up every port on the same cable run; click it to open the port or the cable.
Every device and cable as the switches see them right now. Drag to pan, scroll or pinch to zoom. Hover a device to trace its path to the internet and its power (on a touch screen, tap it once to trace and again to open it); click a cable for its details, or a group of unknown devices to open it.
+
Every device and cable, as the switches see them now.
+ ?Drag to pan; scroll or pinch to zoom. Hover a device to trace its path to the internet and its power (on a touch screen, tap once to trace and again to open it). Click a cable for its details, or a group of unknown devices to open it.
diff --git a/tests/test_app.py b/tests/test_app.py
index f40c508..e7eae05 100644
--- a/tests/test_app.py
+++ b/tests/test_app.py
@@ -95,10 +95,12 @@ class TestPagesAndNav:
def test_home_section_order(self, client):
html = client.get('/', headers=AUTH).get_data(as_text=True)
order = [html.index(m) for m in (
- 'id="device-search"', 'Alert Queue', 'WAN / Fiber', 'g-section-title">Hosts<',
- 'Device Inventory',
+ 'id="attention"', 'id="device-search"', 'Alert Queue', 'WAN / Fiber', 'g-section-title">Hosts<',
+ 'id="unifi-grid"',
)]
assert order == sorted(order)
+ # The needs-attention list replaced the stat cards
+ assert 'lt-stat-card' not in html
def test_dashboard_topology_moved_to_its_own_page(self, client):
html = client.get('/', headers=AUTH).get_data(as_text=True)
@@ -822,3 +824,22 @@ class TestAttention:
html = client.get('/', headers=AUTH).get_data(as_text=True)
assert 'id="attention-body"' in html
assert 'Global Advanced Network Detection And Link Facilitator' in html
+
+
+class TestCalmDashboard:
+ def test_unused_nics_fold_into_one_line(self, client):
+ snap = json.dumps({'hosts': {'large1': {'ip': '10.0.0.2', 'status': 'up', 'source': 'prometheus',
+ 'interfaces': {'eth0': 'up', 'eth1': 'unused', 'eth2': 'unused'}}},
+ 'unifi': []})
+ state = dict(STATE, network_snapshot=snap)
+ with patch.object(gandalf.db, 'get_state', side_effect=lambda k, d=None: state.get(k, d)):
+ html = client.get('/', headers=AUTH).get_data(as_text=True)
+ assert '>eth0<' in html and '>eth1<' not in html
+ assert '+2 unused' in html
+
+ def test_resolved_alerts_are_folded(self, client):
+ ev = {'target_name': 'large1', 'target_detail': '', 'severity': 'warning', 'event_type': 'host_down',
+ 'first_seen': '2026-11-15 01:00:00 UTC', 'resolved_at': '2026-11-15 02:00:00 UTC'}
+ with patch.object(gandalf.db, 'get_recent_resolved', return_value=[ev]):
+ html = client.get('/', headers=AUTH).get_data(as_text=True)
+ assert '' in html