diff --git a/templates/dashboard.html b/templates/dashboard.html index 08ba780..e153d5b 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -604,8 +604,9 @@ function updateFleetMapFiltered(allUnits) { } }); - // Fit bounds if we have markers - if (bounds.length > 0) { + // Only fit bounds on initial load, not on subsequent updates + // This preserves the user's current map view when auto-refreshing + if (bounds.length > 0 && !fleetMapInitialized) { const padding = window.innerWidth < 768 ? [20, 20] : [50, 50]; fleetMap.fitBounds(bounds, { padding: padding }); fleetMapInitialized = true; diff --git a/templates/partials/projects/file_list.html b/templates/partials/projects/file_list.html new file mode 100644 index 0000000..979a8ed --- /dev/null +++ b/templates/partials/projects/file_list.html @@ -0,0 +1,188 @@ + +{% if files %} +
+ {% for file_data in files %} + {% set file = file_data.file %} + {% set session = file_data.session %} + +
+ + {% if file.file_type == 'audio' %} + + + + {% elif file.file_type == 'archive' %} + + + + {% elif file.file_type == 'log' %} + + + + {% elif file.file_type == 'image' %} + + + + {% elif file.file_type == 'measurement' %} + + + + {% else %} + + + + {% endif %} + + +
+
+
+ {{ file.file_path.split('/')[-1] if file.file_path else 'Unknown' }} +
+
+
+ + + {{ file.file_type or 'unknown' }} + + + {# Leq vs Lp badge for RND files #} + {% if file.file_path and '_Leq_' in file.file_path %} + + Leq (15-min avg) + + {% elif file.file_path and '_Lp' in file.file_path and file.file_path.endswith('.rnd') %} + + Lp (instant) + + {% endif %} + + + + {% if file.file_size_bytes %} + {% if file.file_size_bytes < 1024 %} + {{ file.file_size_bytes }} B + {% elif file.file_size_bytes < 1048576 %} + {{ "%.1f"|format(file.file_size_bytes / 1024) }} KB + {% elif file.file_size_bytes < 1073741824 %} + {{ "%.1f"|format(file.file_size_bytes / 1048576) }} MB + {% else %} + {{ "%.2f"|format(file.file_size_bytes / 1073741824) }} GB + {% endif %} + {% else %} + Unknown size + {% endif %} + + + {% if session %} + + Session: {{ session.started_at|local_datetime if session.started_at else 'Unknown' }} + {% endif %} + + + {% if file.downloaded_at %} + + {{ file.downloaded_at|local_datetime }} + {% endif %} + + + {% if file.checksum %} + + + + + + {% endif %} +
+
+ + +
+ {% if file.file_type == 'measurement' or (file.file_path and file.file_path.endswith('.rnd')) %} + + + + + View + + {% endif %} + {# Only show Report button for Leq files #} + {% if file.file_path and '_Leq_' in file.file_path %} + + + + + Report + + {% endif %} + + +
+
+ {% endfor %} +
+{% else %} + +
+ + + +

No files downloaded yet

+

+ Files will appear here once they are downloaded from the sound level meter +

+
+{% endif %} + + diff --git a/templates/roster.html b/templates/roster.html index 157baf8..df989b7 100644 --- a/templates/roster.html +++ b/templates/roster.html @@ -178,8 +178,13 @@
- + + + + +
@@ -351,8 +356,13 @@
- + + + + +
@@ -913,7 +923,7 @@ // Modem fields document.getElementById('editIpAddress').value = unit.ip_address; document.getElementById('editPhoneNumber').value = unit.phone_number; - document.getElementById('editHardwareModel').value = unit.hardware_model; + document.getElementById('editHardwareModel').value = unit.hardware_model || ''; document.getElementById('editDeploymentType').value = unit.deployment_type || ''; // Populate unit picker for modem (uses -edit-modem suffix) diff --git a/templates/unit_detail.html b/templates/unit_detail.html index ae6dd78..2958b88 100644 --- a/templates/unit_detail.html +++ b/templates/unit_detail.html @@ -182,6 +182,42 @@
+ + + @@ -375,8 +411,13 @@
- + + + + +
@@ -434,7 +475,7 @@ {% set input_name = "deployed_with_modem_id" %} {% include "partials/modem_picker.html" with context %} -