mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-08-27 12:00:18 +00:00
fix: cap max hop distance at 300km, link to node detail not analytics
- 1000km filter was too generous for LoRa (record ~250km)
- Uhuru kwa watu 📡 ↔ Bay Area hops at 880km were obviously wrong
- Node links in leaderboard now go to #/nodes/:pk (detail) not /analytics
This commit is contained in:
+2
-2
@@ -1352,8 +1352,8 @@
|
||||
html += `<div class="analytics-section"><h3>🏆 Top 20 Longest Hops</h3><table class="data-table"><thead><tr><th>#</th><th>From</th><th>To</th><th>Distance (km)</th><th>Type</th><th>SNR</th><th>Packet</th></tr></thead><tbody>`;
|
||||
const top20 = data.topHops.slice(0, 20);
|
||||
top20.forEach((h, i) => {
|
||||
const fromLink = h.fromPk ? `<a href="#/nodes/${encodeURIComponent(h.fromPk)}/analytics" class="analytics-link">${esc(h.fromName)}</a>` : esc(h.fromName || '?');
|
||||
const toLink = h.toPk ? `<a href="#/nodes/${encodeURIComponent(h.toPk)}/analytics" class="analytics-link">${esc(h.toName)}</a>` : esc(h.toName || '?');
|
||||
const fromLink = h.fromPk ? `<a href="#/nodes/${encodeURIComponent(h.fromPk)}" class="analytics-link">${esc(h.fromName)}</a>` : esc(h.fromName || '?');
|
||||
const toLink = h.toPk ? `<a href="#/nodes/${encodeURIComponent(h.toPk)}" class="analytics-link">${esc(h.toName)}</a>` : esc(h.toName || '?');
|
||||
const snr = h.snr != null ? h.snr + ' dB' : '<span class="text-muted">—</span>';
|
||||
const pktLink = h.hash ? `<a href="#/packet/${encodeURIComponent(h.hash)}" class="analytics-link mono" style="font-size:0.85em">${esc(h.hash.slice(0, 12))}…</a>` : '—';
|
||||
html += `<tr><td>${i+1}</td><td>${fromLink}</td><td>${toLink}</td><td><strong>${h.dist}</strong></td><td>${esc(h.type)}</td><td>${snr}</td><td>${pktLink}</td></tr>`;
|
||||
|
||||
+2
-2
@@ -88,11 +88,11 @@
|
||||
<script src="channels.js?v=1774075538" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="nodes.js?v=1774354200" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="traces.js?v=1774350000" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="analytics.js?v=1774400100" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="analytics.js?v=1774400200" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="live.js?v=1774072222" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="observers.js?v=1774290000" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="observer-detail.js?v=1774028201" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="node-analytics.js?v=1774400100" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="node-analytics.js?v=1774400200" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
<script src="perf.js?v=1773985649" onerror="console.error('Failed to load:', this.src)"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1722,7 +1722,7 @@ app.get('/api/analytics/distance', (req, res) => {
|
||||
for (let i = 0; i < chain.length - 1; i++) {
|
||||
const a = chain[i], b = chain[i + 1];
|
||||
const dist = haversine(a.lat, a.lon, b.lat, b.lon);
|
||||
if (dist > 1000) continue; // sanity: skip > 1000km (likely bad GPS)
|
||||
if (dist > 300) continue; // sanity: skip > 300km (LoRa record ~250km)
|
||||
|
||||
const aRep = isRepeater(a), bRep = isRepeater(b);
|
||||
let type;
|
||||
|
||||
Reference in New Issue
Block a user