fix(gui): paused/stopped miners shown as broken (red) instead of paused (blue)

A miner an operator has stopped (e.g. 10.4.1.122, VNish miner_state "stopped" ->
OperatingState::Stopped) was read as broken: red hashboards and counted under "not
hashing" instead of "Paused".

Two causes:
1. is_paused() only matched the literal "pause" substring, so "Stopped"/"Stopping"/
   "Suspended" -- every other firmware's word for an intentional, resumable halt --
   fell through to not-paused. Now matches pause/stop/suspend (Error stays broken).
2. encode_component_health applied the paused-blue treatment to hashboards only
   (round 19 #19), so a paused miner's idle fans/power still rendered red. A stopped
   miner's off components are expected, not faults: colour every reported component
   blue when paused (an undetected/Unreachable one still stays grey -- "not present"
   is not "paused").

Verified live against 10.4.1.122 on a headless build: the row now shows all-blue
health (power grey, honestly unreachable) and counts under the Paused KPI, where it
previously showed red boards + "not hashing".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
This commit is contained in:
2026-09-24 13:08:18 -06:00
co-authored by Claude Opus 4.8
parent 3a6a190ce1
commit 8deecf3558
2 changed files with 40 additions and 15 deletions
+18 -13
View File
@@ -439,27 +439,32 @@ fn encode_component_health(
max_boards: usize,
) -> String {
let mut segs: Vec<Segment> = Vec::new();
segs.push((Some(health_color(pal, r.power_health())), SHAPE_BOLT.to_string()));
segs.push((Some(health_color(pal, r.control_health())), SHAPE_BRAIN.to_string()));
// A paused/stopped miner is intentionally halted, not broken: every component
// it reports as idle (power off, fans spun down, boards not hashing) is
// expected, not a fault, so colour each one blue instead of its red/amber
// health colour -- otherwise a paused miner reads as broken (round 19 #19,
// extended: originally boards only, but idle fans/power still showed red).
// A genuinely undetected component (Unreachable) stays grey: even when paused,
// "not present" is not "paused".
let col = |h: crate::model::CompHealth| {
if r.paused && h != crate::model::CompHealth::Unreachable {
pal.accent
} else {
health_color(pal, h)
}
};
segs.push((Some(col(r.power_health())), SHAPE_BOLT.to_string()));
segs.push((Some(col(r.control_health())), SHAPE_BRAIN.to_string()));
let fans = r.fan_healths();
for h in &fans {
segs.push((Some(health_color(pal, *h)), SHAPE_FAN.to_string()));
segs.push((Some(col(*h)), SHAPE_FAN.to_string()));
}
for _ in fans.len()..max_fans {
segs.push((None, SHAPE_GAP.to_string()));
}
let boards = r.board_healths();
for h in &boards {
// A paused miner's boards are intentionally idle, not faulty: show every
// detected board blue instead of its (red) health colour, while every
// other component keeps its normal colour. A genuinely undetected board
// stays grey (round 19 #19).
let color = if r.paused && *h != crate::model::CompHealth::Unreachable {
pal.accent
} else {
health_color(pal, *h)
};
segs.push((Some(color), SHAPE_CHIP.to_string()));
segs.push((Some(col(*h)), SHAPE_CHIP.to_string()));
}
for _ in boards.len()..max_boards {
segs.push((None, SHAPE_GAP.to_string()));