diff --git a/meshview/templates/chat.html b/meshview/templates/chat.html index 21a004c..3c8f2b0 100644 --- a/meshview/templates/chat.html +++ b/meshview/templates/chat.html @@ -15,12 +15,10 @@ .chat-packet:nth-of-type(even) { background-color: #333333; } - @keyframes flash { 0% { background-color: #ffe066; } 100% { background-color: inherit; } } - .chat-packet.flash { animation: flash 3.5s ease-out; } @@ -43,7 +41,7 @@ ✉️ {{ packet.from_node.channel }} - + {{ packet.from_node.long_name or (packet.from_node_id | node_id_to_hex) }} @@ -53,7 +51,7 @@ {% else %} - No packets found. +

No packets found.

{% endfor %} @@ -100,16 +98,25 @@ async function fetchUpdates() { div.className = "row chat-packet flash"; div.dataset.packetId = packet.id; + const date = new Date(packet.import_time); + const formattedTime = date.toLocaleTimeString([], { + hour: 'numeric', + minute: '2-digit', + second: '2-digit' + }); + const formattedDate = `${(date.getMonth() + 1).toString().padStart(2, '0')}/${date.getDate().toString().padStart(2, '0')}/${date.getFullYear()}`; + const formattedTimestamp = `${formattedTime} - ${formattedDate}`; + div.innerHTML = ` - ${new Date(packet.import_time).toLocaleString()} + ${formattedTimestamp} ✉️ ${packet.channel} - + - ${packet.long_name ? packet.long_name : parseInt(packet.from_node_id).toString(16)} + ${packet.long_name || (packet.from_node_id || '').toString(16)} ${escapeHtml(packet.payload)} @@ -128,6 +135,6 @@ async function fetchUpdates() { } } -setInterval(fetchUpdates, 5000); // Poll every 5 seconds +setInterval(fetchUpdates, 5000); {% endblock %}