Clickable home page stat cards; clean up nav; add buttons on list pages; move export/import to home

This commit is contained in:
2026-06-21 12:46:51 -05:00
parent 0b893ffcbb
commit 18456cf8a4
7 changed files with 137 additions and 66 deletions
+21
View File
@@ -61,6 +61,27 @@ function metaSelectChanged(sel, inputId) {
if (e.key === 'Escape' && modal.classList.contains('open')) closeModal();
});
// Apply URL params as initial filter state on battery_list and device_list
document.addEventListener('DOMContentLoaded', function() {
var params = new URLSearchParams(window.location.search);
var statusParam = params.get('status');
if (statusParam !== null) {
var statusSel = document.getElementById('filter-status');
if (statusSel && typeof applyFilters === 'function') {
statusSel.value = statusParam;
applyFilters();
}
}
var fillParam = params.get('fill');
if (fillParam !== null) {
var fillSel = document.getElementById('filter-fill');
if (fillSel && typeof applyDeviceFilters === 'function') {
fillSel.value = fillParam;
applyDeviceFilters();
}
}
});
// Global handler: forms with data-confirm attribute
document.addEventListener('submit', function(e) {
var form = e.target;