dashboard: low-disk warning badge in the header (#138)#151
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fixIt renders on both the sync and main screens (
build_badgesfeeds both), so it's visible during the long initial sync — exactly when an undersized disk fills. Thresholds live inconfig.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 (viashutil.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 inpithead statusand 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%).Closes #138.
🤖 Generated with Claude Code