Skip to content

fix: align camera snapshot modes with the updated backend contract - #68

Merged
nawinds merged 7 commits into
mainfrom
development
Jul 29, 2026
Merged

fix: align camera snapshot modes with the updated backend contract#68
nawinds merged 7 commits into
mainfrom
development

Conversation

@666mxvbee

Copy link
Copy Markdown
Member

Summary

Updates camera snapshot handling to match the latest backend contract across the camera page, zone labeler, and analytics interface.

The annotated snapshot is now the default mode, while stored detection artifacts and live snapshots are loaded from their respective backend endpoints.

Changes

  • Added three camera snapshot modes:
    • Annotated snapshot
    • Last detection snapshot
    • Latest live snapshot
  • Made the annotated snapshot the default when available.
  • Loaded stored detection artifacts from:
    • GET /admin/analytics/cameras/{camera_id}/detections?limit=1
  • Used annotated_snapshot_url for annotated images.
  • Used raw_snapshot_url for the last detection image.
  • Loaded live frames from:
    • GET /admin/cameras/{camera_id}/snapshot
  • Removed usage of the deprecated /cameras/{camera_id}/snapshot endpoint and its query parameters.
  • Added independent per-mode caching and refresh behavior.
  • Applied the same snapshot selector to the camera page, labeler, and analytics.
  • Aligned mode availability with analytics.view and admin.monitoring.view.
  • Updated the Russian and English README documentation.

Verification

  • Production build passes with npm run build
  • No frontend requests use the removed snapshot endpoint
  • Annotated and raw detection artifacts use the latest detection response
  • Live snapshots use the admin monitoring endpoint
  • Snapshot modes are filtered according to user permissions
  • Each snapshot mode has an independent cache
  • Refresh invalidates only the active snapshot mode
  • Russian and English documentation reflects the current backend contract

@nawinds
nawinds merged commit 7b4d5fc into main Jul 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants