diff --git a/web/app.rb b/web/app.rb index 8c724b9..7077f07 100644 --- a/web/app.rb +++ b/web/app.rb @@ -14,9 +14,9 @@ def query_nodes(limit) min_last_heard = Time.now.to_i - 7 * 24 * 60 * 60 rows = db.execute <<~SQL, [min_last_heard, limit] SELECT node_id, short_name, long_name, hw_model, role, snr, - battery_level, voltage, last_heard, uptime_seconds, - channel_utilization, air_util_tx, position_time, - latitude, longitude, altitude + battery_level, voltage, last_heard, first_heard, + uptime_seconds, channel_utilization, air_util_tx, + position_time, latitude, longitude, altitude FROM nodes WHERE last_heard >= ? ORDER BY last_heard DESC diff --git a/web/public/index.html b/web/public/index.html index 472ba3d..2fa397c 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -143,7 +143,7 @@ function addNewNodeChatEntry(n) { const div = document.createElement('div'); - const ts = formatDate(new Date(n.last_heard * 1000)); + const ts = formatDate(new Date(n.first_heard * 1000)); div.className = 'chat-entry-node'; div.innerHTML = `[${ts}] ${n.node_id || ''} ${renderShortHtml(n.short_name || '')} New node: ${n.long_name || ''}`; chatEl.appendChild(div); @@ -294,7 +294,7 @@ seenNodeIds.add(n.node_id); } } - newNodes.sort((a, b) => (a.last_heard ?? 0) - (b.last_heard ?? 0)); + newNodes.sort((a, b) => (a.first_heard ?? 0) - (b.first_heard ?? 0)); for (const n of newNodes) { addNewNodeChatEntry(n); }