import type { RecordValue } from './api'; export function OPNsenseDetails({ device }: { device: RecordValue }) { if (device.source_id !== 'opnsense.base') return null; const inventory = device.inventory as RecordValue | null; function list(key: string, title: string) { const report = inventory?.[key] as RecordValue | undefined; const available = report?.status === 'ok' || report?.status === 'partial'; const rows = Array.isArray(report?.entries) ? report.entries.filter((x): x is string => typeof x === 'string') : []; return

{title}

{!available ?

Nicht ermittelbar

: <> {report?.status === 'partial' &&

Auszug – unvollständige Liste

} {rows.length ?
    {rows.map((line, i) =>
  1. {line}
  2. )}
:

Keine Einträge gemeldet.

} }
; } return <>

VPN-Verbindungen

{list('vpn_configured', 'Konfigurierte VPNs')} {list('wireguard', 'WireGuard · letzter Handshake je Peer')} {list('openvpn', 'OpenVPN · Laufzeitstatus')} {list('ipsec', 'IPsec · aktive Sicherheitsassoziationen')}

Firewallregeln

{list('firewall', 'Aktive PF-Filterregeln · Hauptregelsatz in Auswertungsreihenfolge')}
; }