Skip to content

feat(api): add on-demand device status reset endpoint and UI button #271

@Starosdev

Description

@Starosdev

Feature Request

Environment


Description

When a device is marked as "failed" (due to misconfiguration, transient SMART errors, or threshold false positives), the status persists until the next SMART collection shows all attributes passing. Users currently have no way to manually acknowledge or reset a device's failed status from the UI.

Current Behavior

  • Device status is set to failed when SMART thresholds are exceeded
  • Status auto-resets only when the next POST /api/device/:wwn/smart upload shows all attributes passing
  • Between collections (which may be hours apart), the device stays red with no way to clear it
  • The only workaround is direct database manipulation per the troubleshooting docs

What We Already Have

  • ResetDeviceStatus() method exists in webapp/backend/pkg/database/scrutiny_repository_device.go:73-87
  • Auto-reset logic in webapp/backend/pkg/web/handler/upload_device_metrics.go:71-80
  • The database method works correctly (uses map-based GORM update to handle zero-value, commit 31dfd4a)

What's Missing

  • No API endpoint to trigger reset on demand
  • No frontend button or menu option
  • No handler connecting the API to the existing database method

Proposed Implementation

Backend

  1. Add route: POST /api/device/:wwn/reset-status in server.go
  2. Create handler webapp/backend/pkg/web/handler/reset_device_status.go that calls the existing ResetDeviceStatus() method
  3. Return updated device status in response

Frontend

  1. Add "Reset Status" option to the device detail page action menu (alongside Archive, Delete, Mute)
  2. Add corresponding service method in detail.service.ts
  3. Only show when device status is failed (no point resetting a passing device)

Acceptance Criteria

  • POST /api/device/:wwn/reset-status endpoint resets device to passed status
  • UI button/menu item available on device detail page when device is failed
  • Button is hidden or disabled when device is already passing
  • Status updates immediately in the UI after reset
  • Dashboard reflects the reset status

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions