Accept separate OPNsense inventory and show VPN and PF observations in device details
Rust development slice / linux (push) Failing after 13s
Rust development slice / linux (push) Failing after 13s
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
</>;
|
||||
}
|
||||
Reference in New Issue
Block a user