diff --git a/src/components/custom/FrameDetails.vue b/src/components/custom/FrameDetails.vue index 8118fbd3f40..6cf5dcd141f 100644 --- a/src/components/custom/FrameDetails.vue +++ b/src/components/custom/FrameDetails.vue @@ -27,7 +27,7 @@ Region - {{ getRegion(value.region) }} + {{ getRegion(value) }} RSSI @@ -46,14 +46,10 @@ {{ value.homeId?.toString(16) }} - Source Node ID - {{ value.sourceNodeId }} - - - Destination Node ID - {{ value.destinationNodeId }} + Route + {{ getRepeaters(value) }} - + Ack Requested {{ value.ackRequested }} diff --git a/src/lib/utils.js b/src/lib/utils.js index 33ac6541376..3b337790f84 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -215,26 +215,31 @@ export function getProtocolColor(node) { } } -export function getRegion(region) { +export function getRegion(item) { return ( - znifferRegions.find((r) => r.value === region)?.text || - `Unknown region ${region}` + znifferRegions.find((r) => r.value === item?.region)?.text || + `Unknown region ${item?.region}` ) } export function getRepeaters(item) { const repRSSI = item.repeaterRSSI || [] - return item.repeaters?.length > 0 - ? item.repeaters - .map( - (r, i) => - `${r}${ - repRSSI[i] && !isRssiError(repRSSI[i]) - ? ` (${rssiToString(repRSSI[i])})` - : '' - }`, - ) - .join(', ') - : 'None, direct connection' + const repeatersString = + item.repeaters?.length > 0 + ? item.repeaters + .map( + (r, i) => + `${r}${ + repRSSI[i] && !isRssiError(repRSSI[i]) + ? ` (${rssiToString(repRSSI[i])})` + : '' + }`, + ) + .join(' > ') + : '' + + return `${item.sourceNodeId} >${ + repeatersString ? ' ' + repeatersString + ' ' : '' + }> ${item.destinationNodeId}` } export function getType(item) { return getEnumMemberName(ZWaveFrameType, item.type) diff --git a/src/views/Zniffer.vue b/src/views/Zniffer.vue index f242d33b089..3512c0b7db7 100644 --- a/src/views/Zniffer.vue +++ b/src/views/Zniffer.vue @@ -190,7 +190,6 @@ import { inboundEvents as socketActions } from '@server/lib/SocketEvents' import { znifferRegions } from '../lib/items.js' import { uuid, - getRegion, getRepeaters, getType, getRssi, @@ -475,7 +474,6 @@ export default { const ms = date.getMilliseconds() return `${date.toTimeString().split(' ')[0]}.${ms}` }, - getRegion, getRepeaters, getType, getRssi,