Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device event listing #98

Merged
merged 228 commits into from
Oct 22, 2024
Merged

Device event listing #98

merged 228 commits into from
Oct 22, 2024

Conversation

hardiesoft
Copy link
Member

  • Adds a device event listing for super admins on browse-next
    • Adds end-points to get known event-types per device in a time window, so
  • Tidies up the locations page
  • Temp fix to add location to audio recordings for devices with known locations
  • Pulls in UI changes for browse for device sync interface
  • Display out of date software packages on device diagnostics page
    • Adds an end-point to get latest software versions of camera software across models and release channels.
  • Small fixes for issues with device battery listing
  • Fix latest active times for Stations/locations

- Updated Vue3
- Reworking mask regions component to disallow self-intersecting regions, and allow an apron so regions can be created slightly outside the camera frame.
- Creating wizard steps for manual uploads
- Moving device status out of modal
- Add more info to mobile device cards in DevicesView
- More responsive layouts for device setup.
…on mobile.

- Overflowing tab list component to make longer tabbed nav lists work better on mobile.
…rence image.

- Masked regions are now used when adding tracks via the API to ignore tracks that are exclusively inside the masked region.
- Use common track rect drawing code for showing tracks for trailcam images.
…– the actual track is created the first time a user classification is added. This could be extended to empty CPTV files.
- Automatically add "missed track" tag to CPTV recordings that get manual IDs when they had no tracks.
- Poll every 30 seconds when an open recording is still processing, and update UI when processing is complete.
- Add "dummy-track" to tracker version to make it available to processing.
…adding reference images and mask regions in the same location.

- Fix route for Visits modal from activity view to include selected track.
…adding reference images and mask regions in the same location.

- Fix route for Visits modal from activity view to include selected track. (2)
- Make search url query driven (WIP)
- Make search url query driven (WIP)
- Fix mask-regions api
- Make search url query driven
- Hack in support for "Animal" class from Megadetector
- Show processing progress for visits in API
- Reflect processing progress in the UI.
- Handle scaling DPI when drawing track boxes on trailcam images
- New bulk querying/reporting API which is *many*, *many* times faster for tag filtering queries over longer periods, esp. when the number of recordings in a project grows.
- Thumbnail images on the front-end only get queried when visible.
- CI Tests for new bulk tag mode.
…ny-web into browse-next-upgrades

# Conflicts:
#	api/api/V1/Device.ts
#	api/api/V1/Recording.ts
#	api/api/V1/recordingUtil.ts
#	api/models/index.ts
#	api/package-lock.json
#	browse-next/src/api/Recording.ts
#	browse-next/src/components/ActivitySearchDescription.vue
#	browse-next/src/components/ImageLoader.vue
#	browse-next/src/components/RecordingsList.vue
#	browse-next/src/components/VisitsDailyBreakdown.vue
#	browse-next/src/views/ActivitySearchView.vue
- Add tests for verifying uploaded audio files.
- Fix date range picker
- Hopefully fix Vite build errors
…n the visit with a track matching the visit classification.
…to enable us to parallelise the test run into two jobs in CI, decreasing total CI time.
…to enable us to parallelise the test run into two jobs in CI, decreasing total CI time. (2)
- Remove unused tests
- Use matrix strategy to run test batches
…ces.

- Fix behaviour when re-assigning a device, so we don't orphan recordings.
- Fix handling of inactive devices in browse-next.
…one recording so that the previous device is set inactive rather than deleted.
…ade in new group, and also delete old device.
Copy link
Contributor

@Zainrax Zainrax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍 A few minor comments

Comment on lines 474 to 475
logger.info("!!!!");
console.log(result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor cleanup

@@ -327,7 +323,7 @@ const initBatteryInfoTimeSeries = () => {
}));
if (batteryAll.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should filter out null y values from batteryAll

browse/src/api/Device.api.ts Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hardiesoft you would know better than me, but would it not be easier to use the file signature/magic number from the byte array to determine the file type? Unlikely it needs a change, just wanted to understand the logic/reasoning

@hardiesoft hardiesoft merged commit 4a6a6e9 into main Oct 22, 2024
12 checks passed
@hardiesoft hardiesoft deleted the device-event-listing branch October 22, 2024 00:12
Zainrax added a commit that referenced this pull request Oct 30, 2024
* - Updated bootstrap-vue-next lib
- Updated Vue3
- Reworking mask regions component to disallow self-intersecting regions, and allow an apron so regions can be created slightly outside the camera frame.
- Creating wizard steps for manual uploads
- Moving device status out of modal

* - Fix mask regions tests

* - Fix mask regions tests (2, linting)

* - Fix sunset/sunrise in visits breakdown
- Add more info to mobile device cards in DevicesView

* - Fix reference photo component, make it work on mobile.
- More responsive layouts for device setup.

* - Reference photos are properly scaled when overlaying on CptvPlayer on mobile.
- Overflowing tab list component to make longer tabbed nav lists work better on mobile.

* - Trail cameras use an appropriate daytime image as an automatic reference image.
- Masked regions are now used when adding tracks via the API to ignore tracks that are exclusively inside the masked region.
- Use common track rect drawing code for showing tracks for trailcam images.

* - Added a dummy track to trailcam recordings where there is no track – the actual track is created the first time a user classification is added.  This could be extended to empty CPTV files.

* - Styling dummy track

* - Fix tests

* - Added ability to add a dummy track to a CPTV file that has no tracks.
- Automatically add "missed track" tag to CPTV recordings that get manual IDs when they had no tracks.
- Poll every 30 seconds when an open recording is still processing, and update UI when processing is complete.

* - Improved behaviour when mashing on next/prev buttons in CPTV player very quickly :)

* - Fix null settings read in mask-regions API

* - Remove stations wording on Dashboard

* - API Documentation fix
- Add "dummy-track" to tracker version to make it available to processing.

* - Don't send algorithm with tracks, use default

* - Fix mask-regions api read

* - Clone rather than always update in place DeviceHistory entries for adding reference images and mask regions in the same location.
- Fix route for Visits modal from activity view to include selected track.

* - Clone rather than always update in place DeviceHistory entries for adding reference images and mask regions in the same location.
- Fix route for Visits modal from activity view to include selected track. (2)

* - Improved responsive layout for activity search
- Make search url query driven (WIP)

* - Improved responsive layout for activity search
- Make search url query driven (WIP)
- Fix mask-regions api

* - Improved responsive layout for activity search
- Make search url query driven
- Hack in support for "Animal" class from Megadetector
- Show processing progress for visits in API
- Reflect processing progress in the UI.

* - Add UI to visits when recordings are still processing
- Handle scaling DPI when drawing track boxes on trailcam images

* - Make sure player inherits query params from parent component
- Make recording/visits exports work.

* - Don't delete previous reference images

* Scale UP:
- New bulk querying/reporting API which is *many*, *many* times faster for tag filtering queries over longer periods, esp. when the number of recordings in a project grows.
- Thumbnail images on the front-end only get queried when visible.

* Scale UP:
- CI Tests for new bulk tag mode.

* Merge main

* Merge main, add all tagModes to improved bulk query.

* Address review feedback.

* Small fixes

* Small fixes (2)

* Small fixes (3)

* Small fixes (3)

* Small fixes (4)

* Get rid of legacy bulk recordings query in browse-next

* Rework bulk-query, fixing edge-cases and adding more comprehensive tests.
Improve UI, lazy loading of activity page.

* Fix tests

* Fix tests (2)

* Make sure we return recordings in the correct order.

* Auth.

* Make sure we send recording type when querying!

* Auth again

* Fix recordings export report

* Export larger pages to increase export speed, increase
limit on server-side

* Fix issue where we try to request things from inactive devices and get 403 rejected

* Make sure deleted recordings are not included by default in new bulk queries, and add a test for that.
Display "leporadae" as "rabbit or hare"

* Make sure deleted recordings are not included by default in new bulk queries, and add a test for that.
Display "leporadae" as "rabbit or hare"

* add recording window and low power mode settings

* fix lint

* fix for device extract, move settings up

* readd location check

* Misc fixes and improvements, starting on non-paginated visits API.

* Linting

* Fix tests

* Fix tests (2)

* Fix error event logging

* Fix cron script permissions for platform usage report

* Update docker-compose.yml

* Add alert relationship for project-wide alerts

* Link to device recordings search from device page

* Link to device recordings search from device page
- Fix earliest time detection for location recording results

* Add ability for the user to manage their own email alerts via browse-next UI.

* Linting

* Fix tests

* Improve device -> recordings button appearance on mobile.

* Improve service report email, improve alert email

* Service email should only be for the last 24 hours

* Improve formatting of service errors.
Make audio recordings export include cacophony index column.

* Make stopped alerts work for thermal devices we didn't hear from in over 24 hours.
Improve formatting of service error emails (stop gmail stripping things?)
Fix email link for new-style alert emails.

* Fix latest recording times update for groups.

* Fix latest recording times update for groups. (2)

* Update stopped device email text

* Update stopped device email text (2)

* Revamp stopped devices notification email.

* Skip heartbeat tests (no longer rely on heartbeats for stops)

* Make alert animal image link to recording.

* Tweak stopped devices logic

* Tweak stopped devices logic again

* Fleshing out daily/weekly digest emails + user preferences.

* add fox tag

* Daily+weekly digest emails.
Store user timezone info

* Add missing tag icons.

* Add missing tag icons. (2)

* Add fox tag

* Add ability to hide false-trigger tracks in Recording View.

* White outlines around email tag classification icons so that they show up in dark-mode contexts.

* - Improve thumbnail selection in recordings view.
- Fix stopped devices query
- Add aussie tags to classifications.

* - Diagnostics

* fix device settings

* fix time format in settings

* - Adjust stopped device query

* - Add ability for super-users to view any group they're not already part of (as an admin user)

* - Implement deletion of recordings in browse-next and tweak deletion API to update book-keeping for group and stations lastRecordingTimes.

* - Modify locations query to be able to return only locations that don't have zero recordings associated with them, so that deleting the last recording in a location allows that location to be hidden.

* - Do latest time fixups for bulkDelete API too.

* - Fix tooltips for activity search

* - Fix local saving of view false-triggers setting when viewing as a super-user

* - Fix hiding of AI false-trigger tags for tracks where there is a user non-false-trigger tag.

* - Fix requests for tracks that are user-created and don't have thumbnails.

* - Fix user settings persistence

* - Fix issue with removing track tags twice.

* - Cosmetic tweak – images that fail to load.

* - Fix thumbnail selection code.

* - Fix display of sunset/sunrise times in visits breakdown for 24/7 cameras.

* - Fix date offsets for digests

* - Fix date offsets for digests

* - Fix date offsets for digests

* - Fix date offsets for digests (2)

* - Remove beta version wording, add additional filter events

* - Fixes for digest email timings and thumbnail selection.

* - Allow viewing live thumbnails and cptv recordings in local dev mode.
- Add track replay button to tagging view.
- Hide audio mode stuff for now.

* - Fix unitVersion grouping in daily service error emails.

* - Linting

* - Additional options for finding a project to view as a super-user

* fix to make update device settings invariant

* only update if changed

* - Complete reset password flow for browse-next.

* - Complete reset password flow for browse-next.
- Add cypress ui tests for reset password flow.

* - Make project switcher work better
- Properly reset activity search when projects are switched (WIP)

* - Fix linting errors

* - Fix broken activity lists
- Fix weirdness with project switching (when on activity page)

* - Fix CPTV player resizing when browser window is very short vertically, but has a desktop width breakpoint.
- Fix date field not being populated when on activity page and page refreshed.

* - Fix type import

* - Updated device view, device "dashboard" WIP

* - Updated device view, device "dashboard" WIP (2)

* - Fix visitContext filtering on dashboard.

* - Fix recording window length calulation for absolute recordindg windows.
- Fix display of visits activity search description if a device was previously filtered on.

* - In daily/weekly digest emails, try to fall back to another parent class icon if species icon for tag is not found.

* - Improve thumbnail selection for recordings list.

* - Improve pathological cases of recording search where there are many many recordings in a project over a long time span, and the user wants to search over "all time".  To handle this case, start searching over a max time window of 3 months on the API side, and progressively widen that search until there are no results left or the limit has been reached.

* - Handle recordings export where there are (legacy) recordings without a location.

* - Abort in-flight requests if multiple searches are done in quick succession to keep state correct.
- Script to fixup latest recording times
- Fix locations table view
- Fix incorrect thumbnail selection in recordings activity search
- Don't sync activity search context when we enter a recording.
- Don't try to load tag-icons in track tagger view unless the tagging interface is actually expanded.

* - Fix station-related tests to not use status-recording length test recordings
- Add missing recording labels.

* - When we delete the last recording that isn't a status recording, properly fixup last recording times.

* - Handle aborted activity search queries more gracefully in the UI.

* - Handle aborted activity search queries more gracefully in the UI. (2)

* - Fix recording export length truncation when using non-advanced export

* - Fix recording export length truncation when using non-advanced export (2)

* add device sync-settings to browse-next

* - Fixes to dashboard showing non-predator visits and locations
- Fix for unselect locations in dashboard
- Remove unused dashboard view options.
- Add a 'time-sensitive' param to the recordings query, to return from slower queries after a time-out, as long as there are some results gathered.  This will make the UI appear more responsive for sparse queries over longer time periods.
- Add ability to go to activity for locations from locations page for both visits and recordings scoped to the given location.

* - Make max-zoom on maps be not quite as zoomed in (15), since sometimes tiles aren't available for the max zoom level of 16.

* - Tidy locations page some more

* fix custom recording windows

* - Change page size calculation for recordings search.

* - Add a script to fixup device history settings corruption by ratThresh script, and fix ratThresh script so that it doesn't nuke settings.

* - Make ratThresh script only update device settings if there are new human tagged rodents.

* - Make ratThresh script only update device settings if there are new human tagged rodents (2)

* remove loction from device history settings. Remove poweron/off for tc2

* - Adding test coverage for device-settings

* - Make sure location specific device settings get purged when creating a new station for a device, while previously set device recording window and recording settings get retained.

* minor fix on settings api, handle no settings in browse next

* - Fix tagged recording query
- Set lastConnectionTime to null if newer recordings are uploaded via sidekick so that we see a device as being "offline" from that point.
- Fix device settings update in place issue.

* - Sync changes with upstream.

* - Remove ratthreshold debug code

* - Fix UI tests

* - Moving settings sync UI to device setup tab (WIP)
- Adding flag to get latest *synced* settings
- Add tests to confirm/sync settings, and to test getting latest synced settings.

* - Moving settings sync UI to device setup tab
- Adding flag to get latest *synced* settings
- Add latest battery info to devices listing, device diagnostic page, and link to device page from recording view.

* - Moving settings sync UI to device setup tab
- Adding flag to get latest *synced* settings
- Add latest battery info to devices listing, device diagnostic page, and link to device page from recording view.

* - Add spinner while saving window settings

* - Fix lastActiveTime for stations when recordings are uploaded from Devices

* - Better relative time and layout formatting for Locations view.
- Update to Vue 3.5

* - Add device events listing for super-users.
- Add API end-points for getting all known event types, and for all known event types for a given device in the last month.

* - Fix clearing event filter

* - Better format nested event item details.

* - Fix battery level caching bug for aborted api requests

* - Add ability to rename locations that need renaming if the current user is an admin of the project.

* - Add ability to rename locations that need renaming if the current user is an admin of the project (2).

* update to match browse-next, fix getting settings

* - Add known device locations to audio files that are missing location until we get that information embedded in audio metadata

* - Fix UI tests

* - Fix merge

* - Fix CptvPlayer overlay when browser has pixelRatio < 1.0 (zoomed out)

* - Various cosmetic fixes to browse next for mobile viewports.

* Use github actions instead of travis

* Update dockerhub login

* Install docker compose

* - Added new versions of cptv-decoder
- Added m4a metadata extraction to uploads

* - Added new versions of cptv-decoder
- Added m4a metadata extraction to uploads (2)

* - Fix test

* - Remove vestiges of unused vue-multiselect.

* - Bump cptv-player-vue version

* - Bump cptv-player-vue version (2)

* - Only set device active when getting a new recording uploaded via sidekick if it's currently inactive, and there's no active instance of that device elsewhere in the system.

* - Fix log warning.

* - Fix vie build error?

* - Update eslint on browse-next
- Add tests for verifying uploaded audio files.

* - Parallelize github actions jobs
- Fix date range picker
- Hopefully fix Vite build errors

* - Add logging to release build script

* - Add logging to release build script (2)

* - Add IS_CI_ENV to release job.

* - Fix sub-species use of icons in digest emails

* - Clicking a visit should always select+display the first recording in the visit with a track matching the visit classification.

* - Split api integration tests into two batches of roughly equal time to enable us to parallelise the test run into two jobs in CI, decreasing total CI time.

* - Split api integration tests into two batches of roughly equal time to enable us to parallelise the test run into two jobs in CI, decreasing total CI time. (2)

* - Check pwd for tests.

* - Actually add moved spec files!

* - Re-balance test batches

* - Clean up test external type imports
- Remove unused tests
- Use matrix strategy to run test batches

* - Use npm cache

* - Use npm ci instead of npm install to take advantage of github actions cache (once run against `main`)

* - More comprehensive testing of deleted, inactive and reassigned devices.
- Fix behaviour when re-assigning a device, so we don't orphan recordings.
- Fix handling of inactive devices in browse-next.

* - Before re-registering a device in tests, make sure it has at least one recording so that the previous device is set inactive rather than deleted.

* - Fix routing

* - If moving a device from the new group, soft delete all recordings made in new group, and also delete old device.

* - Show when there are no events for device in the last month

* - Only check battery levels on devices we think aren't stopped or offline.

* - Fix device status image retrieval.

* - Sometimes we need to keep asking for frames till we get a good one on cptv single image component.

* - Allow alerts on `unidientified` tags.

* - Resolving review comments

* - Resolving review comments (2)

---------

Co-authored-by: Abra <[email protected]>
Co-authored-by: Patrick Baxter <[email protected]>
Co-authored-by: cam <[email protected]>
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.

3 participants