feat: checkbox batch trip delete on the Pi (local-only)

- Pi history page gets a select checkbox column + 'Delete selected' button
  (mirrors the server UI)
- POST /api/trips/delete batch endpoint
- app_sql.delete_trips_batch() + deleted_trip_markers table so a later trip
  rebuild can't resurrect locally-deleted trips
- Deletion is local-only: raw tracking rows are kept and the remote server
  is never notified (it keeps its archival copy recomputed from uploaded rows)
This commit is contained in:
Mathieu Moran
2026-08-15 16:55:30 -04:00
parent c9d36cca33
commit 99035e86ee
4 changed files with 85 additions and 2 deletions
+6 -1
View File
@@ -15,8 +15,11 @@
{# ── Trip list ──────────────────────────────────────────────────── #}
<div class="col-12 col-xl-5">
<div class="card shadow-sm">
<div class="card-header py-2">
<div class="card-header py-2 d-flex justify-content-between align-items-center">
<h6 class="text-primary fw-bold m-0">Recorded trips</h6>
<button id="delete-selected-btn" class="btn btn-sm btn-outline-danger" type="button" hidden title="Delete selected trips">
<i class="fas fa-trash fa-fw"></i> Delete selected
</button>
</div>
<div class="card-body p-0">
<div id="trip-loading" class="text-center text-muted py-4">
@@ -27,6 +30,7 @@
{{ data_table(
"trip-list",
[
{"key": "", "label": "", "sortable": false, "class": "text-center"},
{"key": "started", "label": "Started", "sortable": true},
{"key": "distance", "label": "km", "sortable": true},
{"key": "duration", "label": "Time", "sortable": true},
@@ -39,6 +43,7 @@
deletable=true
) }}
<script>document.getElementById('trip-list').dataset.deleteUrl = '/api/trip/';</script>
<script>document.getElementById('trip-list').dataset.batchDeleteUrl = '/api/trips/delete';</script>
</div>
</div>
</div>