feat: odometer in trips/overview, trips upload toggle, fix video count
- OBD odometer now logged to tracking rows on every GPS snapshot - trips table: START_ODOMETER/END_ODOMETER columns (migration) - build_trip_summaries: picks odometer from first/last tracking row - list_trips: uses real OBD odo, falls back to cumulative distance - overview stats: odometer_km (max seen from OBD), video_count fixed - history page: Odometer column shows start→end km per trip - app_upload: TRIPS_UPLOAD_SETTING_KEY, is_trips_upload_enabled() - _upload_tracking_batch: skips when trips upload is off - settings: separate 'Upload trips & GPS' toggle from dashcam toggle Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -13,6 +13,7 @@ const lastPhoneAddressLink = document.getElementById('last-phone-address-link');
|
||||
let initialUplinkStatusLoaded = false;
|
||||
|
||||
const fields = {
|
||||
tripsUpload: document.getElementById('trips-upload-enabled'),
|
||||
dashcamUpload: document.getElementById('dashcam-upload-enabled'),
|
||||
retention: document.getElementById('retention-days'),
|
||||
videoConvert: document.getElementById('video-convert-enabled'),
|
||||
@@ -79,6 +80,7 @@ function applyErrors(errors) {
|
||||
|
||||
function populate(settings) {
|
||||
const thresholds = settings.alert_thresholds;
|
||||
fields.tripsUpload.checked = settings.trips_upload_enabled;
|
||||
fields.dashcamUpload.checked = settings.dashcam_upload_enabled;
|
||||
fields.retention.value = settings.local_video_retention_days;
|
||||
fields.videoConvert.checked = settings.video_convert_enabled;
|
||||
@@ -105,6 +107,7 @@ function populate(settings) {
|
||||
|
||||
function payload() {
|
||||
return {
|
||||
trips_upload_enabled: fields.tripsUpload.checked,
|
||||
dashcam_upload_enabled: fields.dashcamUpload.checked,
|
||||
local_video_retention_days: Number(fields.retention.value),
|
||||
video_convert_enabled: fields.videoConvert.checked,
|
||||
|
||||
Reference in New Issue
Block a user