fix: move Foreign-Flagged Nodes list above the unscoped-relay table

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 <noreply@anthropic.com>
This commit is contained in:
dborup
2026-07-18 20:45:43 +02:00
co-authored by Claude Sonnet 5
parent 492d15c43b
commit a55c237ea1
2 changed files with 7 additions and 4 deletions
+4 -3
View File
@@ -4940,10 +4940,11 @@ function destroy() { _stopRolesRefresh(); _stopScopesRefresh(); _stopForeignTraf
'A small amount of unscoped traffic is normal — <code>flood.max.unscoped</code> caps it rather than blocking it outright. Disproportionate volume or % here is what\'s worth investigating on that specific node. ' +
foreignNote +
'</p>' +
body +
'<h3 style="margin:24px 0 4px">Foreign-Flagged Nodes (' + foreignNodes.length.toLocaleString() + ')</h3>' +
'<h4 style="margin:0 0 4px">Foreign-Flagged Nodes (' + foreignNodes.length.toLocaleString() + ')</h4>' +
'<p class="text-muted" style="margin:0 0 8px;font-size:0.85em">Nodes whose most recent advertised GPS position fell outside the configured geo_filter.</p>' +
foreignNodesBody;
foreignNodesBody +
'<h4 style="margin:24px 0 4px">Repeaters Relaying Unscoped Traffic</h4>' +
body;
} catch (e) {
el.innerHTML = '<p class="text-muted">Failed to load repeater relay stats.</p>';
}
+3 -1
View File
@@ -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');