mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-06-10 17:24:56 +02:00
more changes
This commit is contained in:
@@ -482,6 +482,11 @@ function formatAverageHopCount(value) {
|
||||
return value - lower === 0.5 ? lower : Math.round(value);
|
||||
}
|
||||
|
||||
function formatAverageHopCountWithActual(value) {
|
||||
if (value === null || value === undefined || !Number.isFinite(value)) return "—";
|
||||
return `${formatAverageHopCount(value)} (${value.toFixed(1)})`;
|
||||
}
|
||||
|
||||
function reliabilityBucketFor(row) {
|
||||
return reliabilityBuckets.find(bucket => bucket.matches(row)) || null;
|
||||
}
|
||||
@@ -561,7 +566,7 @@ function renderReliabilityMap(gatewayRows, nodesById) {
|
||||
icon: reachMapIcon(`${Math.round(row.percent)}%`, bucket.color),
|
||||
}).bindPopup(`
|
||||
<b>${nodeLink(row.nodeId, nodesById)}</b><br>
|
||||
Reliability: ${row.percent.toFixed(1)}% · Avg. hops ${formatAverageHopCount(row.avgHopCount)}<br>
|
||||
Reliability: ${row.percent.toFixed(1)}% · Avg. hops ${formatAverageHopCountWithActual(row.avgHopCount)}<br>
|
||||
Heard:
|
||||
<button class="reach-heard-link" type="button" onclick="openGatewayPacketModal(${row.nodeId})">
|
||||
${row.heardCount}
|
||||
@@ -771,7 +776,7 @@ async function loadReachReport(nodeId = reachNodeId) {
|
||||
</button>
|
||||
<span class="text-secondary">(${reportResults.length})</span>
|
||||
</td>
|
||||
<td>${formatAverageHopCount(row.avgHopCount)}</td>
|
||||
<td>${formatAverageHopCountWithActual(row.avgHopCount)}</td>
|
||||
<td>${row.percent.toFixed(1)}%</td>
|
||||
</tr>
|
||||
`).join("")
|
||||
|
||||
Reference in New Issue
Block a user