From a55c237ea10a8c90b6e112bba925f5f2a1292479 Mon Sep 17 00:00:00 2001 From: dborup Date: Sat, 18 Jul 2026 20:45:43 +0200 Subject: [PATCH] fix: move Foreign-Flagged Nodes list above the unscoped-relay table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reordered so the node list (what's actually accumulating right now, worth checking back on) comes first, with the unscoped-relay-volume table — the part that needs more data to be interesting — below it. Added a heading to the relay table for symmetry with the new sub-heading above it. Co-Authored-By: Claude Sonnet 5 --- public/analytics.js | 7 ++++--- test-analytics-foreign-traffic-tab.js | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/public/analytics.js b/public/analytics.js index 45d439ef..36f651a2 100644 --- a/public/analytics.js +++ b/public/analytics.js @@ -4940,10 +4940,11 @@ function destroy() { _stopRolesRefresh(); _stopScopesRefresh(); _stopForeignTraf 'A small amount of unscoped traffic is normal — flood.max.unscoped caps it rather than blocking it outright. Disproportionate volume or % here is what\'s worth investigating on that specific node. ' + foreignNote + '

' + - body + - '

Foreign-Flagged Nodes (' + foreignNodes.length.toLocaleString() + ')

' + + '

Foreign-Flagged Nodes (' + foreignNodes.length.toLocaleString() + ')

' + '

Nodes whose most recent advertised GPS position fell outside the configured geo_filter.

' + - foreignNodesBody; + foreignNodesBody + + '

Repeaters Relaying Unscoped Traffic

' + + body; } catch (e) { el.innerHTML = '

Failed to load repeater relay stats.

'; } diff --git a/test-analytics-foreign-traffic-tab.js b/test-analytics-foreign-traffic-tab.js index 8aaa5f78..2502e6a9 100644 --- a/test-analytics-foreign-traffic-tab.js +++ b/test-analytics-foreign-traffic-tab.js @@ -171,7 +171,9 @@ function fakeEl() { const el = fakeEl(); await ctx.window._analyticsRenderForeignTrafficTab(el); assert.ok(el.innerHTML.includes('Foreign-Flagged Nodes (2)'), 'heading should show the correct count'); - const foreignSectionHtml = el.innerHTML.slice(el.innerHTML.indexOf('Foreign-Flagged Nodes')); + const startIdx = el.innerHTML.indexOf('Foreign-Flagged Nodes'); + const endIdx = el.innerHTML.indexOf('Repeaters Relaying Unscoped Traffic'); + const foreignSectionHtml = el.innerHTML.slice(startIdx, endIdx > -1 ? endIdx : undefined); assert.ok(!foreignSectionHtml.includes('RepeaterA'), 'a non-foreign node must not appear in the foreign-nodes section'); const idxNew = el.innerHTML.indexOf('NewForeign'); const idxOld = el.innerHTML.indexOf('OldForeign');