diff --git a/src/meshcore_hub/web/static/js/spa/pages/routes.js b/src/meshcore_hub/web/static/js/spa/pages/routes.js index f822b3b..145d55c 100644 --- a/src/meshcore_hub/web/static/js/spa/pages/routes.js +++ b/src/meshcore_hub/web/static/js/spa/pages/routes.js @@ -62,10 +62,11 @@ function renderSummaryStrip(routes) { function renderPathChips(route) { const nodes = route.route_nodes || []; const arrow = route.reversible !== false ? '\u2194' : '\u2192'; + const prefixLen = 2 * (route.match_width || 1); return html`
${nodes.map((rn, i) => html` ${i > 0 ? html`${arrow}` : nothing} - ${rn.name || rn.public_key?.slice(0, 8) || rn.node_id.slice(0, 8)} + ${rn.name ? html`${rn.name} (${rn.public_key?.slice(0, prefixLen)})` : (rn.public_key?.slice(0, prefixLen) || rn.node_id.slice(0, 8))} `)}
`; } @@ -148,20 +149,21 @@ function renderDetailContent(route, detail) { ` : html`
${t('routes.no_observers')}
`} ${matches.length > 0 ? html`
${t('routes.recent_matches')}: -
+
${matches.map(m => { + const prefixLen = 2 * (route.match_width || 1); const pathLookup = new Map( (route.route_nodes || []).map(rn => [rn.expected_hash?.toLowerCase(), rn]) ); - return html`
+ return html`
${(m.hops || []).slice(0, 10).map((h, i) => { - const rn = pathLookup.get((h.node_hash || '').toLowerCase()); + const rn = pathLookup.get((h.node_hash || '').toLowerCase().slice(0, prefixLen)); return html` ${i > 0 ? html`\u2192` : nothing} ${rn - ? html`${rn.name || h.node_hash}` - : html`${h.node_hash}`} + ? html`${(h.node_hash || '').toLowerCase()}` + : html`${(h.node_hash || '').toLowerCase()}`} `; })}
`;