From 7efc2ef37a1709e583e29d3cc71a1f2af872daf3 Mon Sep 17 00:00:00 2001 From: James Pattinson Date: Thu, 11 Dec 2025 15:42:21 +0000 Subject: [PATCH] Usability fixes --- web/admin.html | 23 +++++------------------ web/reports.html | 35 +++++++++++++++++------------------ 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/web/admin.html b/web/admin.html index 653ae7f..c7695df 100644 --- a/web/admin.html +++ b/web/admin.html @@ -437,7 +437,7 @@ .form-actions { display: flex; gap: 1rem; - justify-content: flex-end; + justify-content: space-between; padding-top: 1rem; border-top: 1px solid #eee; } @@ -848,18 +848,12 @@
- - -
@@ -392,7 +390,6 @@ - @@ -568,6 +565,13 @@ return; } + // Sort by ETA (ascending) + pprs.sort((a, b) => { + if (!a.eta) return 1; + if (!b.eta) return -1; + return new Date(a.eta) - new Date(b.eta); + }); + tbody.innerHTML = ''; document.getElementById('reports-table-content').style.display = 'block'; @@ -586,7 +590,6 @@ const statusText = ppr.status.charAt(0).toUpperCase() + ppr.status.slice(1).toLowerCase(); row.innerHTML = ` - @@ -622,7 +625,15 @@ utcDateStr += 'Z'; } const date = new Date(utcDateStr); - return date.toISOString().slice(0, 16).replace('T', ' '); + + // Format as dd/mm/yy hh:mm + const day = String(date.getDate()).padStart(2, '0'); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const year = String(date.getFullYear()).slice(-2); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + + return `${day}/${month}/${year} ${hours}:${minutes}`; } // Clear filters @@ -672,18 +683,6 @@ downloadCSV(headers, csvData, 'ppr_reports.csv'); } - function exportToXLS() { - if (currentPPRs.length === 0) { - showNotification('No data to export', true); - return; - } - - // For XLS export, we'll create a CSV that Excel can open - // In a production environment, you'd want to use a proper XLS library - exportToCSV(); - showNotification('XLS export uses CSV format (compatible with Excel)'); - } - function downloadCSV(headers, data, filename) { const csvContent = [ headers.join(','),
ID Status Aircraft Type${ppr.id} ${statusText} ${ppr.ac_reg} ${ppr.ac_type}