[client/ui] Port IPv6 toggle and paired default-route filter to Wails UI

Brings two main-side PRs' UI behavior across the Fyne→Wails rewrite:

- #5631 (IPv6 overlay support): add "Enable IPv6" row to the polished
  SettingsNetwork tab; the legacy screens/Settings.tsx already had it,
  but modules/settings/SettingsNetwork.tsx (the user-visible Settings
  window) was missing the toggle.
- #6150 (mirror v4 exit selection onto v6 pair): replace the literal
  "0.0.0.0/0" || "::/0" filter in screens/Networks.tsx with an
  isDefaultRoute() helper that handles the daemon's merged-range
  display string (e.g. "0.0.0.0/0, ::/0"), so paired v4/v6 exit
  nodes are classified correctly.
This commit is contained in:
Zoltán Papp
2026-05-18 10:25:18 +02:00
parent f468f15a30
commit 7fae703a27
2 changed files with 16 additions and 1 deletions

View File

@@ -45,6 +45,12 @@ export function SettingsNetwork() {
label={"Enable Server Routes"}
helpText={"Advertise this host's local routes to other peers."}
/>
<FancyToggleSwitch
value={!config.disableIpv6}
onChange={(v) => setField("disableIpv6", !v)}
label={"Enable IPv6"}
helpText={"Use IPv6 addressing for the NetBird overlay network."}
/>
</SectionGroup>
</>
);

View File

@@ -55,7 +55,7 @@ export default function Networks() {
const overlapping = useMemo(() => filterOverlapping(routes), [routes]);
const exitNodes = useMemo(
() => routes.filter((r) => r.range === "0.0.0.0/0" || r.range === "::/0"),
() => routes.filter((r) => isDefaultRoute(r.range)),
[routes],
);
@@ -146,6 +146,15 @@ function NetworkList({
);
}
// range is the merged display string from the daemon, e.g. "0.0.0.0/0",
// "::/0", or "0.0.0.0/0, ::/0" when a v4 exit node has a paired v6 entry.
function isDefaultRoute(range: string): boolean {
return range.split(",").some((part) => {
const trimmed = part.trim();
return trimmed === "0.0.0.0/0" || trimmed === "::/0";
});
}
function filterOverlapping(routes: Network[]): Network[] {
const byRange = new Map<string, Network[]>();
for (const r of routes) {