Add delete with confirmation for trips and dashcam

- Confirmation modal in server base.html (window.confirmDelete promise helper)
- Trip delete: trash button in Replay column (server-only via data-deletable on
  trip-list div), DELETE /api/v1/portal/trip/<id>, removes computed trip only
  (raw tracking_points kept)
- Dashcam delete: trash button next to download, DELETE /api/v1/portal/dashcam/<id>,
  removes from DB + disk (best-effort file removal)
- history.js: delete button gated on data-deletable='1' attribute; click handler
  intercepts before replay logic
- db.py: delete_trip(), delete_dashcam_file() helpers

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 04:40:22 -04:00
co-authored by Copilot
parent a13d74e18e
commit 7aa9ffda16
7 changed files with 151 additions and 6 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
{% macro data_table(id, columns, empty_title, empty_message) %}
<div class="data-list" id="{{ id }}" data-data-list>
{% macro data_table(id, columns, empty_title, empty_message, deletable=false) %}
<div class="data-list" id="{{ id }}" data-data-list{% if deletable %} data-deletable="1"{% endif %}>
<div class="table-responsive data-list-table" data-data-list-table hidden>
<table class="table table-hover align-middle mb-0">
<thead>