/** * Port Table — top ports by traffic * Ball Studios */ import React from 'react'; interface Port { port: number; protocol: string; rx_bytes: number; tx_bytes: number; } function fmt(bytes: number): string { if (bytes < 1024) return `${bytes} B`; if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`; return `${(bytes / 1048576).toFixed(2)} MB`; } export default function PortTable({ ports }: { ports: Port[] }) { if (!ports.length) { return
Port-level data requires iptables collection (disabled by default).
; } return ( {ports.map(p => ( ))}
PortProto⬇ Inbound⬆ Outbound
{p.port} {p.protocol.toUpperCase()} {fmt(p.rx_bytes)} {fmt(p.tx_bytes)}
); }