Summary
Port feature from upstream AnalogJ/scrutiny PR AnalogJ#822 to allow muting notifications per device.
Problem
When a drive is degraded and waiting for replacement, users receive repeated failure notifications. There's no way to silence notifications for a specific device while still monitoring others.
Solution
Add a muted field to devices and UI controls to enable/disable notifications per device.
Changes Required
Backend
Database Migration - New migration m20251108044508:
- Add
Muted bool column to Device table
Files to modify:
webapp/backend/pkg/database/interface.go - Add UpdateDeviceMuted method
webapp/backend/pkg/database/scrutiny_repository_device.go - Implement UpdateDeviceMuted
webapp/backend/pkg/database/scrutiny_repository_migrations.go - Add migration
webapp/backend/pkg/models/device.go - Add Muted bool field
webapp/backend/pkg/notify/notify.go - Skip notification if device is muted
webapp/backend/pkg/web/server.go - Add /device/:wwn/mute and /device/:wwn/unmute routes
New files:
webapp/backend/pkg/web/handler/mute_device.go
webapp/backend/pkg/web/handler/unmute_device.go
webapp/backend/pkg/database/migrations/m20251108044508/device.go
Frontend
Files to modify:
webapp/frontend/src/app/core/models/device-model.ts - Add muted: boolean
webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.html - Show muted icon
webapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.scss - Muted icon styles
webapp/frontend/src/app/layout/common/detail-settings/detail-settings.component.html - Enable notification toggle
webapp/frontend/src/app/layout/common/detail-settings/detail-settings.component.ts - Handle mute state
webapp/frontend/src/app/modules/detail/detail.component.html - Show muted icon, enable settings
webapp/frontend/src/app/modules/detail/detail.component.scss - Muted icon styles
webapp/frontend/src/app/modules/detail/detail.component.ts - Implement settings dialog
webapp/frontend/src/app/modules/detail/detail.service.ts - Add setMuted API call
API Endpoints
| Endpoint |
Method |
Description |
/api/device/:wwn/mute |
POST |
Mute device notifications |
/api/device/:wwn/unmute |
POST |
Unmute device notifications |
Upstream Reference
Screenshots (from upstream PR)
Dashboard with muted device indicator and detail page settings dialog.
Acceptance Criteria
Summary
Port feature from upstream AnalogJ/scrutiny PR AnalogJ#822 to allow muting notifications per device.
Problem
When a drive is degraded and waiting for replacement, users receive repeated failure notifications. There's no way to silence notifications for a specific device while still monitoring others.
Solution
Add a
mutedfield to devices and UI controls to enable/disable notifications per device.Changes Required
Backend
Database Migration - New migration
m20251108044508:Muted boolcolumn to Device tableFiles to modify:
webapp/backend/pkg/database/interface.go- AddUpdateDeviceMutedmethodwebapp/backend/pkg/database/scrutiny_repository_device.go- ImplementUpdateDeviceMutedwebapp/backend/pkg/database/scrutiny_repository_migrations.go- Add migrationwebapp/backend/pkg/models/device.go- AddMuted boolfieldwebapp/backend/pkg/notify/notify.go- Skip notification if device is mutedwebapp/backend/pkg/web/server.go- Add/device/:wwn/muteand/device/:wwn/unmuteroutesNew files:
webapp/backend/pkg/web/handler/mute_device.gowebapp/backend/pkg/web/handler/unmute_device.gowebapp/backend/pkg/database/migrations/m20251108044508/device.goFrontend
Files to modify:
webapp/frontend/src/app/core/models/device-model.ts- Addmuted: booleanwebapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.html- Show muted iconwebapp/frontend/src/app/layout/common/dashboard-device/dashboard-device.component.scss- Muted icon styleswebapp/frontend/src/app/layout/common/detail-settings/detail-settings.component.html- Enable notification togglewebapp/frontend/src/app/layout/common/detail-settings/detail-settings.component.ts- Handle mute statewebapp/frontend/src/app/modules/detail/detail.component.html- Show muted icon, enable settingswebapp/frontend/src/app/modules/detail/detail.component.scss- Muted icon styleswebapp/frontend/src/app/modules/detail/detail.component.ts- Implement settings dialogwebapp/frontend/src/app/modules/detail/detail.service.ts- AddsetMutedAPI callAPI Endpoints
/api/device/:wwn/mute/api/device/:wwn/unmuteUpstream Reference
Screenshots (from upstream PR)
Dashboard with muted device indicator and detail page settings dialog.
Acceptance Criteria
mutedcolumn