diff --git a/Plugin/unraid/pages/fallback.php b/Plugin/unraid/pages/fallback.php index 16534f0..acb8c63 100644 --- a/Plugin/unraid/pages/fallback.php +++ b/Plugin/unraid/pages/fallback.php @@ -427,13 +427,21 @@ function _daemonRow(p, checkInterval) { // intervals is a wedged process or a dead one — and the state value it left behind is a claim // about the past, not the present. function _freshness(node, checkInterval) { - const a = node.state_age; + const a = node.state_age; + // A dry run redirects its state writes to a per-PID copy so the live file is never touched. + // That is the point of it — but it means the live file goes on ageing while a preview runs, + // and "daemon: dry run" beside "state age: 5d — stale" reads as a fault when it is the + // designed behaviour. Say which it is rather than leaving the operator to chase it. + const dry = node.proc && node.proc.running && node.proc.mode === 'dry-run'; + if (a === null || a === undefined) { + if (dry) return ['dim', 'none — dry run does not write live state']; return node.is_me ? ['bad', 'no state file — fallback has never run here'] : ['dim', 'not readable from here']; } const limit = Math.max(120, (checkInterval || 30) * 4); + if (a > limit && dry) return ['dim', _age(a) + ' — not refreshed: dry run writes elsewhere']; return [a > limit ? 'bad' : 'good', _age(a) + (a > limit ? ' — stale' : '')]; } @@ -495,7 +503,7 @@ function _nodeCard(node, data) { ${vvEscHtml(node.hostname)} ${node.is_me ? 'US' : ''} - ${(node.is_me && fCls !== 'bad') ? _ptStatus(st) : ''} + ${(node.is_me && fCls === 'good') ? _ptStatus(st) : ''} ${_stateBadge(state)}