mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Use server-side date filtering for device event history chart
The device event history chart previously fetched all events and filtered
client-side. This wires the existing created_from API parameter to the
frontend so filtering happens in the backend.
Also fixes a bug where the Today filter returned no results: rusqlite was
storing datetimes with a space separator ("YYYY-MM-DD HH:MM:SS+00:00")
while SQL filters used RFC 3339 with a T separator, causing string
comparisons to fail for same-day events. All datetime storage across
device_events, devices, and notifications is now consistently RFC 3339.
A migration converts existing records.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2e8604a354
commit
e1287e5a0f
@@ -0,0 +1,3 @@
|
||||
UPDATE device_events SET created_on = REPLACE(created_on, ' ', 'T') WHERE created_on LIKE '____-__-__ %';
|
||||
UPDATE devices SET last_seen = REPLACE(last_seen, ' ', 'T') WHERE last_seen LIKE '____-__-__ %';
|
||||
UPDATE notifications SET created_on = REPLACE(created_on, ' ', 'T') WHERE created_on LIKE '____-__-__ %';
|
||||
Reference in New Issue
Block a user