@@ -208,6 +213,44 @@
} catch {}
}
+ // Fetch paths through this node (full-screen view)
+ api('/nodes/' + encodeURIComponent(n.public_key) + '/paths', { ttl: CLIENT_TTL.nodeDetail }).then(pathData => {
+ const el = document.getElementById('fullPathsContent');
+ if (!el) return;
+ if (!pathData || !pathData.paths || !pathData.paths.length) {
+ el.innerHTML = '
No paths observed through this node
';
+ return;
+ }
+ document.querySelector('#fullPathsSection h4').textContent = `Paths Through This Node (${pathData.totalPaths} unique, ${pathData.totalTransmissions} transmissions)`;
+ const COLLAPSE_LIMIT = 10;
+ function renderPaths(paths) {
+ return paths.map(p => {
+ const chain = p.hops.map(h => {
+ const isThis = h.pubkey === n.public_key;
+ const name = escapeHtml(h.name || h.prefix);
+ const link = h.pubkey ? `
${name}` : `
${name}`;
+ return link;
+ }).join(' → ');
+ return `
+
${chain}
+
${p.count}× · last ${timeAgo(p.lastSeen)} ·
Analyze →
+
`;
+ }).join('');
+ }
+ if (pathData.paths.length <= COLLAPSE_LIMIT) {
+ el.innerHTML = renderPaths(pathData.paths);
+ } else {
+ el.innerHTML = renderPaths(pathData.paths.slice(0, COLLAPSE_LIMIT)) +
+ `
`;
+ document.getElementById('showAllFullPaths').addEventListener('click', function() {
+ el.innerHTML = renderPaths(pathData.paths);
+ });
+ }
+ }).catch(() => {
+ const el = document.getElementById('fullPathsContent');
+ if (el) el.innerHTML = '
Failed to load paths
';
+ });
+
} catch (e) {
body.innerHTML = `
Failed to load node: ${e.message}
`;
}