mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-20 15:49:55 +00:00
[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:
@@ -45,6 +45,12 @@ export function SettingsNetwork() {
|
|||||||
label={"Enable Server Routes"}
|
label={"Enable Server Routes"}
|
||||||
helpText={"Advertise this host's local routes to other peers."}
|
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>
|
</SectionGroup>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default function Networks() {
|
|||||||
|
|
||||||
const overlapping = useMemo(() => filterOverlapping(routes), [routes]);
|
const overlapping = useMemo(() => filterOverlapping(routes), [routes]);
|
||||||
const exitNodes = useMemo(
|
const exitNodes = useMemo(
|
||||||
() => routes.filter((r) => r.range === "0.0.0.0/0" || r.range === "::/0"),
|
() => routes.filter((r) => isDefaultRoute(r.range)),
|
||||||
[routes],
|
[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[] {
|
function filterOverlapping(routes: Network[]): Network[] {
|
||||||
const byRange = new Map<string, Network[]>();
|
const byRange = new Map<string, Network[]>();
|
||||||
for (const r of routes) {
|
for (const r of routes) {
|
||||||
|
|||||||
Reference in New Issue
Block a user