mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-26 21:47:20 +00:00
c22871c0bd
Several Off toggles on the Thresholds page did nothing or did the opposite, because each layer read 0, -1 and "missing" differently: - PMG and Docker restart/memory-limit defaults: the toggle sends -1 and NormalizePMGDefaults/NormalizeDockerDefaults turned anything <= 0 back into the factory value, so Off reverted on save. The Docker restart-loop and memory-limit checks also had no Off at all. - Backup and snapshot critical age: the editor sanitizers and the save payload raised a 0 critical to the warning age, so turning critical off made backups go critical at the warning age. - A Docker container override saved for CPU alone carried DisableConnectivity=false and re-enabled that container's state alerts over a disabled Docker default. - Per-server PMG cells, PMG bulk edit and per-container restart and memory-limit cells wrote fields ThresholdConfig does not have, so the backend dropped them on save. 0 is now Off for these counts; negative values (the toggle's -1) are stored as 0. Keys an older alerts.json or an import omits decode as ThresholdCountUnset and take the factory value, so existing installs keep their alerts; persistence resolves the marker before writing. A PMG quarantine growth level with one half Off turns that level off instead of invalidating the spec and skipping the whole check. Docker container overrides re-enable state alerts only with their own severity, as applyThresholdOverride does elsewhere. The frontend keeps a 0 critical age Off, the group header says "Restart loop off", and rows only offer metrics an override can store. AI Patrol's threshold adapter still maps an Off alert threshold to its factory value; that is a Patrol product decision and is left as is.