mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-02-19 08:56:23 +00:00
Update security.tsx
This commit is contained in:
@@ -221,19 +221,17 @@ export function Security() {
|
|||||||
|
|
||||||
const loadNetworkInterfaces = async () => {
|
const loadNetworkInterfaces = async () => {
|
||||||
try {
|
try {
|
||||||
console.log("[v0] Loading network interfaces...")
|
|
||||||
const data = await fetchApi("/api/network")
|
const data = await fetchApi("/api/network")
|
||||||
console.log("[v0] Network API response:", JSON.stringify(data?.interfaces?.length), "interfaces found")
|
// The API returns interfaces in separate arrays: physical_interfaces, bridge_interfaces, etc.
|
||||||
if (data.interfaces) {
|
// The generic "interfaces" array only holds uncategorized types and is usually empty.
|
||||||
console.log("[v0] Interface types:", data.interfaces.map((i: any) => `${i.name}(${i.type})`).join(", "))
|
const all = [
|
||||||
const relevant = data.interfaces
|
...(data.physical_interfaces || []),
|
||||||
.filter((i: any) => ["physical", "bridge", "bond", "vlan"].includes(i.type))
|
...(data.bridge_interfaces || []),
|
||||||
.sort((a: any, b: any) => a.name.localeCompare(b.name))
|
...(data.interfaces || []),
|
||||||
console.log("[v0] Filtered interfaces:", relevant.map((i: any) => i.name).join(", "))
|
].sort((a: any, b: any) => a.name.localeCompare(b.name))
|
||||||
setNetworkInterfaces(relevant)
|
setNetworkInterfaces(all)
|
||||||
}
|
} catch {
|
||||||
} catch (err) {
|
// Silently fail - select will just show "Any interface"
|
||||||
console.log("[v0] Error loading network interfaces:", err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user