/** * Port-forward traffic diagram. * Solid = path to firewall; dashed = SSH tunnel (explicit stroke — Tailwind stroke-* is unreliable on SVG). */ import { useTranslation } from 'react-i18next' import appIcon from '../../assets/opsxshell-app-icon.png' import firewallIcon from '../../assets/diagram/network-firewall.png' import serverIcon from '../../assets/diagram/ec2.png' import cloudGcp from '../../assets/diagram/cloud-gcp.svg' import cloudCf from '../../assets/diagram/cloud-cf.svg' import type { ForwardRuleType } from './forwardRules' interface ForwardArchitectureDiagramProps { type: ForwardRuleType } const SOLID = '#fb7185' const DASH = '#60a5fa' function AppBadge() { return (
) } function IconImg({ src, className, rounded, }: { src: string className?: string rounded?: boolean }) { return ( ) } function SolidPath({ d }: { d: string }) { return ( ) } function DashPath({ d }: { d: string }) { return ( ) } export default function ForwardArchitectureDiagram({ type }: ForwardArchitectureDiagramProps) { const { t } = useTranslation('common') const caption = type === 'local' ? t('portForward.diagram.localCaption') : type === 'remote' ? t('portForward.diagram.remoteCaption') : t('portForward.diagram.dynamicCaption') return (
{t('portForward.diagram.title')}
{/* Lines under icons */} {type === 'local' && ( <> {/* App → firewall (solid) */} {/* App → SSH host → remote targets (dashed) */} )} {type === 'remote' && ( <> {/* Same span as Local/Dynamic: ~App→Firewall */} )} {type === 'dynamic' && ( <> )} {type === 'local' && ( <>
{/* Firewall + SSH host: same column, vertically centered as a pair */}
)} {type === 'remote' && ( <> {/* Match Local/Dynamic left inset so solid gap equals App→Firewall */}
)} {type === 'dynamic' && ( <>
{/* Firewall + SSH host stacked & vertically centered */}
)}

{caption}

) }