From 4aeeab5df7f38ba4dfa65b97eec56522d85b5da7 Mon Sep 17 00:00:00 2001 From: you Date: Wed, 18 Mar 2026 22:55:22 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20node=20detail=20Recent=20Activity=20?= =?UTF-8?q?=E2=80=94=20fetch=20health=20data=20for=20real=20packet=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Desktop detail panel was only showing adverts as 'Recent Activity'. Now fetches /health endpoint too and displays all recent packets (adverts, channel msgs, DMs) with type icons and Analyze links. --- public/nodes.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/public/nodes.js b/public/nodes.js index 497f7d9..47a5622 100644 --- a/public/nodes.js +++ b/public/nodes.js @@ -295,7 +295,11 @@ panel.innerHTML = '
Loading…
'; try { - const data = await api('/nodes/' + encodeURIComponent(pubkey)); + const [data, healthData] = await Promise.all([ + api('/nodes/' + encodeURIComponent(pubkey)), + api('/nodes/' + encodeURIComponent(pubkey) + '/health').catch(() => null) + ]); + data.healthData = healthData; renderDetail(panel, data); } catch (e) { panel.innerHTML = `
Error: ${e.message}
`; @@ -305,6 +309,7 @@ function renderDetail(panel, data) { const n = data.node; const adverts = data.recentAdverts || []; + const recent = data.healthData?.recentPackets || []; const roleColor = ROLE_COLORS[n.role] || '#6b7280'; const hasLoc = n.lat != null && n.lon != null; const nodeUrl = location.origin + '#/nodes/' + encodeURIComponent(n.public_key); @@ -337,9 +342,9 @@
-

Recent Activity (${adverts.length})

+

Recent Activity (${recent.length})

- ${adverts.length ? adverts.map(a => { + ${recent.length ? recent.map(a => { let decoded; try { decoded = JSON.parse(a.decoded_json); } catch {} const pType = PAYLOAD_TYPES[a.payload_type] || 'Packet';