mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-02-18 16:36:27 +00:00
Update security.tsx
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user