Update security.tsx

This commit is contained in:
MacRimi
2026-02-14 17:59:44 +01:00
parent 3e8661f5ca
commit 070a1b47e5

View File

@@ -96,6 +96,7 @@ export function Security() {
dport: "", sport: "", source: "", iface: "", comment: "", level: "host",
})
const [savingRule, setSavingRule] = useState(false)
const [networkInterfaces, setNetworkInterfaces] = useState<{name: string, type: string, status: string}[]>([])
// Security Tools state
const [toolsLoading, setToolsLoading] = useState(true)
@@ -217,6 +218,21 @@ export function Security() {
}
}
const loadNetworkInterfaces = async () => {
try {
const data = await fetchApi("/api/network")
if (data.interfaces) {
// Get physical + bridge + bond interfaces (exclude vm_lxc virtual taps)
const relevant = data.interfaces
.filter((i: any) => ["physical", "bridge", "bond", "vlan"].includes(i.type))
.sort((a: any, b: any) => a.name.localeCompare(b.name))
setNetworkInterfaces(relevant)
}
} catch {
// Silently fail - user can still type manually if needed
}
}
const loadSecurityTools = async () => {
try {
setToolsLoading(true)