Skip to content

Commit

Permalink
fix(zniffer): route display for inbound frames, show failed hop (#3774)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Jun 17, 2024
1 parent 74b2fae commit 107f147
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,13 @@ export function getRoute(item, withRssi = false) {
const dir = item.direction === 'inbound' ? '←' : '→'
const hop = item.hop !== undefined ? item.hop : -1
const route = [
item.sourceNodeId,
item.direction === 'outbound'
? item.sourceNodeId
: item.destinationNodeId,
...(item.repeaters || []),
item.destinationNodeId,
item.direction === 'outbound'
? item.destinationNodeId
: item.sourceNodeId,
].map(
(r, i) =>
`${r}${
Expand All @@ -247,9 +251,13 @@ export function getRoute(item, withRssi = false) {
for (let i = 0; i < route.length; i++) {
routeString += route[i]
if (i < route.length - 1) {
routeString += ` ${
hop === i ? '<b class="text-decoration-underline">' : ''
}${dir}${hop === i ? '</b>' : ''} `
if (i === item.failedHop) {
routeString += ' ! '
} else {
routeString += ` ${
hop === i ? '<b class="text-decoration-underline">' : ''
}${dir}${hop === i ? '</b>' : ''} `
}
}
}
} else {
Expand Down

0 comments on commit 107f147

Please sign in to comment.