feat(alerts): per-device mute/snooze with timeframe#17
Merged
Conversation
Let a user silence alerts for a device that is intentionally down (e.g.
a mobile miner turned off on purpose) without removing it.
- New commands/mute.rs: muted_devices.json map keyed by IP (ASIC) /
device_id (OverMobile), { mutedUntil: Option<i64> }. None = until
re-enabled; Some(ts) auto-expires. Atomic write (tmp + rename).
- Commands set_device_mute / clear_device_mute / get_muted_devices,
registered in lib.rs. get_muted_devices prunes expired entries.
- Alert engine (check_alerts + check_mobile_alerts) skips muted devices:
no alert, no notification, no cloud push.
- MuteControl.tsx dropdown (1h / 4h / 24h / custom date-time / until
re-enabled) doubling as the 'Muted until …' badge, wired into the
ASIC and OverMobile detail pages.
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
Silence alerts for a device that's intentionally down (e.g. a mobile miner turned off on purpose) without removing it. Priority feature of the v1.6 batch.
Backend
commands/mute.rs:muted_devices.jsonmap keyed by IP (ASIC) /device_id(OverMobile), value{ mutedUntil: Option<i64> }.None= until re-enabled;Some(epoch_ms)auto-expires. Persisted with an atomic write (tmp + rename).set_device_mute(id, mutedUntil),clear_device_mute(id),get_muted_devices()— registered inlib.rs.get_muted_devicesprunes expired entries (auto-clear).check_alerts+check_mobile_alertsskip muted devices — no alert, no notification, no cloud push; expired mutes excluded automatically.Frontend
MuteControl.tsxdropdown: 1h · 4h · 24h · Custom date/time · Until I re-enable, doubling as theMuted until …badge so it's obvious why a device is quiet.MinerDetail, keyed on IP) and OverMobile (MobileMinerDetail, keyed on deviceId) detail pages.Verification
cargo check✅ ·npx tsc --noEmit✅muted_devices.jsonwrites.)Deferred (nice-to-have from the spec)