Repository navigation
fix(webui): match the RAID alert to raid_alert instead of a bare comparison - #3690
Merged
nicolargo merged 1 commit intoAug 26, 2026
Merged
Conversation
…arison The WebUI decided degradation with `diskData.used < diskData.available` and nothing else, while the authoritative RaidPlugin.raid_alert applies three rules before that comparison: raid0 is always OK, an inactive array is CRITICAL, and an unknown device count is left undecorated. Two of those omissions are visible: - A raid0 array reporting fewer used than available devices was drawn as "Degraded mode" in warning colour. raid0 has no redundancy, so that comparison carries no meaning there — msg_curse excludes raid0 from the same banner. - `used` is None whenever the parser cannot read the device count, and in JavaScript `null < 5` is true, so an unreadable array was reported as degraded. The TUI leaves it undecorated. Comparing both implementations across seven arrays, four disagreed before and none after. One asymmetry is preserved rather than fixed: raid_alert returns OK for an inactive raid0 because the raid0 branch runs first. This change matches that so the two views agree; whether the Python ordering itself is right is a separate question, and the inactive line is rendered regardless.
Owner
|
Thanks for the PR @ntdatt812 Merged into develop |
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.
The defect
The WebUI decides RAID degradation with one comparison (
glances/outputs/static/js/components/plugin-raid.vue:68):The authoritative implementation on the Python side applies three rules before reaching that comparison (
glances/plugins/raid/__init__.py:157):Two of the omissions are visible to the user:
raid0. It has no redundancy, so
used < availablecarries no meaning there —msg_curseexcludes it from the very same "Degraded mode" banner (:143,array_stats['type'] != 'raid0' and ...). The WebUI drew the banner and the warning colour anyway.Unknown device count.
usedisNonewhenever the parser cannot read it — which is exactly whyraid_alertguards it. In JavaScriptnull < 5is true, so an array whose device count could not be read was reported as degraded:The TUI leaves that array undecorated.
Measured
Both implementations run over the same seven arrays:
Four disagreed before, none after. The Python column calls the real
RaidPlugin.raid_alert.One asymmetry preserved, not fixed
raid_alertreturnsOKfor an inactive raid0, because the raid0 branch runs before the inactive check. This change matches that, so the two views agree — but I want to flag it rather than quietly change it: whether that ordering is what you intend is a separate call, and the WebUI renders the└─ Status inactiveline regardless of the colour. Say the word and I will swap the two branches on both sides in a follow-up.Verification
There is no JS test runner in this repo, so the evidence is the comparison table above plus the rebuilt bundle:
glances.jsrebuilt withnpm run build(webpack 5.107.2, compiled successfully), 686767 → 686883 bytes, and committed alongside the source as the other WebUI changes in this repo do.ESLint on the changed file: 0 errors. The single
vue/require-default-propwarning is pre-existing ondevelopand untouched.