From 9f11238d43b004cea7a0cef7e64823372a5bd587 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sat, 14 Feb 2026 18:21:53 +0100 Subject: [PATCH] Update security.tsx --- AppImage/components/security.tsx | 35 ++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/AppImage/components/security.tsx b/AppImage/components/security.tsx index 318b4823..310f4115 100644 --- a/AppImage/components/security.tsx +++ b/AppImage/components/security.tsx @@ -193,6 +193,7 @@ export function Security() { loadApiTokens() loadSslStatus() loadFirewallStatus() + loadNetworkInterfaces() loadSecurityTools() }, []) @@ -220,16 +221,19 @@ export function Security() { const loadNetworkInterfaces = async () => { try { + console.log("[v0] Loading network interfaces...") const data = await fetchApi("/api/network") + console.log("[v0] Network API response:", JSON.stringify(data?.interfaces?.length), "interfaces found") if (data.interfaces) { - // Get physical + bridge + bond interfaces (exclude vm_lxc virtual taps) + console.log("[v0] Interface types:", data.interfaces.map((i: any) => `${i.name}(${i.type})`).join(", ")) const relevant = data.interfaces .filter((i: any) => ["physical", "bridge", "bond", "vlan"].includes(i.type)) .sort((a: any, b: any) => a.name.localeCompare(b.name)) + console.log("[v0] Filtered interfaces:", relevant.map((i: any) => i.name).join(", ")) setNetworkInterfaces(relevant) } - } catch { - // Silently fail - user can still type manually if needed + } catch (err) { + console.log("[v0] Error loading network interfaces:", err) } } @@ -2619,12 +2623,18 @@ ${(report.sections && report.sections.length > 0) ? `
- setNewRule({...newRule, iface: e.target.value})} - className="h-9 text-sm" - /> + className="w-full h-9 rounded-md border border-border bg-card px-3 text-sm" + > + + {networkInterfaces.map((iface) => ( + + ))} +
@@ -2802,8 +2812,15 @@ ${(report.sections && report.sections.length > 0) ? `
- setEditRule({ ...editRule, iface: e.target.value })} - placeholder="e.g. vmbr0" className="h-8 text-xs mt-0.5" /> +