From 742fa2a15eae8081b3b5b11b79a3605232931573 Mon Sep 17 00:00:00 2001 From: root <165865819+brianshea2@users.noreply.github.com> Date: Thu, 25 Jul 2024 03:01:55 +0000 Subject: [PATCH] only show most recent packet details per reporting node --- website/index.html | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/website/index.html b/website/index.html index f11a798..e7e3272 100644 --- a/website/index.html +++ b/website/index.html @@ -253,17 +253,22 @@ - ${Object.entries(seenBy).sort((a, b) => b[1] - a[1]).map(([topic, seen]) => { - const captures = topic.match(/^(.*)(?:\/2\/e\/(.*)\/(![0-9a-f]+)|\/2\/map\/)$/) - return ` + ${Array.from( + new Map( + Object.entries(seenBy) + .map(([topic, seen]) => (m => ({seen, via: m[3] ?? id, root: m[1], chan: m[2]}))(topic.match(/^(.*)(?:\/2\/e\/(.*)\/(![0-9a-f]+)|\/2\/map\/)$/))) + .sort((a, b) => a.seen - b.seen) + .map(v => [v.via, v]) + ).values(), + ({seen, via, root, chan}) => ` - - - + + + ` - }).join('')} + ).reverse().join('')}
Last seenviaroot topicchannel
${since(seen)}${captures[3] && captures[3] !== id ? (num => data[num] ? nodeLink(num, captures[3]) : captures[3])(parseInt(captures[3].slice(1), 16)) : 'self'}${html(captures[1])}${html(captures[2] ?? 'n/a (MapReport)')}${via !== id ? (num => data[num] ? nodeLink(num, via) : via)(parseInt(via.slice(1), 16)) : 'self'}${html(root)}${html(chan ?? 'n/a (MapReport)')}
` const populateDetailsLayer = () => {