Calmer dashboard and navigation, short page intros
Lint / JS (eslint) (push) Successful in 27s
Lint / Python (flake8) (push) Successful in 2m30s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 2m0s
Test / Python Tests (pytest) (push) Successful in 1m46s
Lint / Python (flake8) (pull_request) Successful in 1m43s
Lint / JS (eslint) (pull_request) Successful in 11s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 1m7s
Test / Python Tests (pytest) (pull_request) Successful in 1m10s
Lint / JS (eslint) (push) Successful in 27s
Lint / Python (flake8) (push) Successful in 2m30s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 2m0s
Test / Python Tests (pytest) (push) Successful in 1m46s
Lint / Python (flake8) (pull_request) Successful in 1m43s
Lint / JS (eslint) (pull_request) Successful in 11s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 1m7s
Test / Python Tests (pytest) (pull_request) Successful in 1m10s
Dashboard: the stat cards are gone (Needs attention says it better); host cards fold unused NICs into one line and move Suppress to a small icon; UniFi devices become a compact list; recently resolved alerts fold. Navigation keeps Dashboard, Topology, Rack and Cutsheet in view with Alert history and Suppressions under More; the phone drawer groups them the same way and gains Start maintenance, and the phone header hides the user name and the Ctrl+K hint so GANDALF fits. Rack and topology intros are one line with the how-to behind a ?; the topology problem bar is one line until opened. README updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+23
-2
@@ -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 '<details class="g-section resolved-fold">' in html
|
||||
|
||||
Reference in New Issue
Block a user