Skip to content

dashboard: low-disk warning badge in the header (#138)#151

Merged
VijitSingh97 merged 2 commits into
mainfrom
claude/disk-badge
Jun 4, 2026
Merged

dashboard: low-disk warning badge in the header (#138)#151
VijitSingh97 merged 2 commits into
mainfrom
claude/disk-badge

Conversation

@VijitSingh97
Copy link
Copy Markdown
Collaborator

What

Adds a prominent low-disk badge to the dashboard's top bar:

  • Disk N% full (warn) at ≥85% used of the data filesystem
  • ⚠ Disk N% full (bad) at ≥95%, with a tooltip pointing at the fix

It renders on both the sync and main screens (build_badges feeds both), so it's visible during the long initial sync — exactly when an undersized disk fills. Thresholds live in config.py (DISK_WARN_PERCENT / DISK_CRITICAL_PERCENT).

Why this shape (correcting the issue)

The issue said the dashboard "has no free-disk metric" — that turned out to be inaccurate: collector/system.py:get_disk_usage() already collects it (via shutil.disk_usage) and it's shown as a bar. The real gap is that a bar at 95% is easy to miss; a full data disk corrupts monerod's DB mid-write, so it deserves a prominent alert. So this PR reuses the existing metric and just adds the badge — no new collection. (A runtime disk check in pithead status and the broader badge framework in #104 remain separate.)

Tests & docs

  • tests/web/test_views.py: critical / warn / ample / missing-data cases. Dashboard suite 421 passed, 93% coverage (gate is 80%).
  • CHANGELOG entry. The badge tooltip is its own documentation.

Closes #138.

🤖 Generated with Claude Code

VijitSingh97 and others added 2 commits June 4, 2026 08:33
The data filesystem fills as the chains grow and logs accumulate, and a full disk
corrupts monerod's DB mid-write. Disk usage is already collected and shown as a bar,
but the bar is easy to miss — add a prominent top-bar badge: a `warn` at 85% used and
a `bad` critical alert at 95%, on both the sync and main screens (build_badges feeds
both). Thresholds live in config (DISK_WARN_PERCENT / DISK_CRITICAL_PERCENT).

Tests: critical / warn / ample / missing-data cases for the badge. Dashboard suite
421 passed, 93% coverage. CHANGELOG updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolve CHANGELOG.md conflict by keeping both [Unreleased] entries — the #137
doctor boot-check (landed on main via #150) and this branch's #138 disk badge.
Code files auto-merged; full suite green (dashboard 421, stack 97, compose + lint).
@VijitSingh97 VijitSingh97 merged commit e502ff6 into main Jun 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No runtime disk guard: sync/log growth can silently fill the disk; dashboard has no free-disk metric

1 participant