Accept separate OPNsense inventory and show VPN and PF observations in device details
Rust development slice / linux (push) Failing after 13s

This commit is contained in:
2026-11-19 19:53:51 +01:00
parent ac6f940e2e
commit 89a58c609c
7 changed files with 106 additions and 5 deletions
+2
View File
@@ -17,6 +17,7 @@ import { allowed } from './safety';
import { CatalogCheckNotice } from './catalog-check';
import { devicePlatform } from './script-catalog';
import { DeviceInventoryPanels, systemDetails } from './device-inventory';
import { OPNsenseDetails } from './opnsense';
import { DeviceCustomerTransfer } from './device-customer-transfer';
import { HypervisorAssignment, HypervisorLabel } from './device-hypervisor';
import { ErrorBox, errorText, useResource } from './resource';
@@ -300,6 +301,7 @@ function DeviceDetail({
success={purposeSaved}
onSaved={() => { setPurposeSaved(true); detail.reload(); }}
/>
<OPNsenseDetails device={d} />
<DeviceInventoryPanels device={d} />
{volumes.length > 0 && (
<section>
+24
View File
@@ -0,0 +1,24 @@
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 <div key={key}><h3>{title}</h3>{!available ? <p>Nicht ermittelbar</p> : <>
{report?.status === 'partial' && <p>Auszug – unvollständige Liste</p>}
{rows.length ? <ol>{rows.map((line, i) => <li key={i}><code>{line}</code></li>)}</ol> : <p>Keine Einträge gemeldet.</p>}
</>}</div>;
}
return <>
<section><h2>VPN-Verbindungen</h2>
{list('vpn_configured', 'Konfigurierte VPNs')}
{list('wireguard', 'WireGuard · letzter Handshake je Peer')}
{list('openvpn', 'OpenVPN · Laufzeitstatus')}
{list('ipsec', 'IPsec · aktive Sicherheitsassoziationen')}
</section>
<section><h2>Firewallregeln</h2>{list('firewall', 'Aktive PF-Filterregeln · Hauptregelsatz in Auswertungsreihenfolge')}</section>
</>;
}