"use client"; import { useState, useEffect } from "react"; import { Tabs, Tab } from "@/components/ui/Tabs"; import { DataTable } from "@/components/ui/DataTable"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card"; import { useVlans, useInterfaces, useIpVersions, useRemoteIps, useMacBandwidth, useFlowTypes, useFlowOrigins } from "@/lib/api-advanced"; import { IpDetails } from "@/components/ui/IpDetails"; import { RemoteIpDetailModal } from "@/components/ui/RemoteIpDetailModal"; import { HelpTrigger } from "@/components/help/HelpTrigger"; import { RoutingGeoTab } from "@/components/network/RoutingGeoTab"; import { fmtBytes } from "@/lib/utils"; export default function NetworkInfrastructurePage() { const [selectedRemoteIp, setSelectedRemoteIp] = useState(null); useEffect(() => { document.title = "Network Topology | BackOne - Deep Package Inspection"; }, []); const { data: interfaces, isLoading: loadingInterfaces } = useInterfaces(); const { data: vlans, isLoading: loadingVlans } = useVlans(); const { data: remoteIps, isLoading: loadingRemoteIps } = useRemoteIps(); const { data: ipVersions, isLoading: loadingIpVersions } = useIpVersions(); const { data: macBandwidth, isLoading: loadingMacBandwidth } = useMacBandwidth(); const { data: flowTypes, isLoading: loadingFlowTypes } = useFlowTypes(); const { data: flowOrigins, isLoading: loadingFlowOrigins } = useFlowOrigins(); return (

Network Topology

Physical, logical, and geographic network topologies.

Network Interfaces row.iface_name }, { header: "Role", accessor: (row: any) => row.iface_role }, { header: "Download", accessor: (row) => fmtBytes(row.download) }, { header: "Upload", accessor: (row) => fmtBytes(row.upload) }, { header: "Total", accessor: (row) => fmtBytes(row.total) }, ]} /> VLANs row.vlan_id }, { header: "Label", accessor: (row: any) => row.vlan_label }, { header: "Download", accessor: (row) => fmtBytes(row.download) }, { header: "Upload", accessor: (row) => fmtBytes(row.upload) }, { header: "Total", accessor: (row) => fmtBytes(row.total) }, ]} />
Top Remote IPs setSelectedRemoteIp(row.remote_ip)} columns={[ { header: "IP Address", accessor: (row: any) => row.remote_ip ? (
{row.remote_ip}
) : "—" }, { header: "IP Version", accessor: (row) => `IPv${row.ip_version}` }, { header: "Download", accessor: (row) => fmtBytes(row.download) }, { header: "Upload", accessor: (row) => fmtBytes(row.upload) }, { header: "Total", accessor: (row) => fmtBytes(row.total) }, ]} />
IP Versions row.ip_version_label }, { header: "Total Traffic", accessor: (row) => fmtBytes(row.total) }, ]} /> MAC Bandwidth {row.mac_address} }, { header: "Manufacturer", accessor: (row: any) => {row.manufacturer} }, { header: "Total", accessor: (row) => fmtBytes(row.total) }, ]} />
Flow Types row.flow_type_label }, { header: "Download", accessor: (row) => fmtBytes(row.download) }, { header: "Upload", accessor: (row) => fmtBytes(row.upload) }, { header: "Total", accessor: (row) => fmtBytes(row.total) }, ]} /> Flow Origins row.flow_origin_label }, { header: "Download", accessor: (row) => fmtBytes(row.download) }, { header: "Upload", accessor: (row) => fmtBytes(row.upload) }, { header: "Total", accessor: (row) => fmtBytes(row.total) }, ]} />
{selectedRemoteIp && ( setSelectedRemoteIp(null)} /> )}
); }