fix: TLS status dot colors — grey/red/green

- na (passthrough, Central doesn't handle TLS): grey checkmark
- error (terminate but cert missing): red alert icon
- ok (terminate and cert exists): green checkmark

Previously passthrough showed green (wrong — Central isn't doing
anything) and missing certs showed amber (should be red — broken).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 23:36:47 +00:00
parent a4fbecc61e
commit c96af69189

View File

@@ -21,20 +21,22 @@ import { usePageHelp } from '../hooks/usePageHelp';
import type { RegisteredService } from '../services/api/networking'; import type { RegisteredService } from '../services/api/networking';
import { servicesApi, haproxyApi } from '../services/api/networking'; import { servicesApi, haproxyApi } from '../services/api/networking';
function StatusDot({ status, label }: { status: 'ok' | 'warning' | 'na'; label: string }) { function StatusDot({ status, label }: { status: 'ok' | 'error' | 'na'; label: string }) {
return ( return (
<span className="inline-flex items-center gap-1 text-xs"> <span className="inline-flex items-center gap-1 text-xs">
{status === 'ok' && <CheckCircle className="h-3.5 w-3.5 text-green-500" />} {status === 'ok' && <CheckCircle className="h-3.5 w-3.5 text-green-500" />}
{status === 'warning' && <AlertCircle className="h-3.5 w-3.5 text-amber-500" />} {status === 'error' && <AlertCircle className="h-3.5 w-3.5 text-red-500" />}
{status === 'na' && <span className="h-3.5 w-3.5 text-muted-foreground inline-flex items-center justify-center">&mdash;</span>} {status === 'na' && <CheckCircle className="h-3.5 w-3.5 text-muted-foreground" />}
<span className="text-muted-foreground">{label}</span> <span className="text-muted-foreground">{label}</span>
</span> </span>
); );
} }
function getTlsStatus(service: RegisteredService, certDomains: Set<string>): 'ok' | 'warning' | 'na' { function getTlsStatus(service: RegisteredService, certDomains: Set<string>): 'ok' | 'error' | 'na' {
if (service.tls === 'passthrough' || service.backend.type === 'tcp-passthrough') return 'ok'; // Passthrough: Central doesn't handle TLS — grey (not applicable)
return certDomains.has(service.domain) ? 'ok' : 'warning'; if (service.tls === 'passthrough' || service.backend.type === 'tcp-passthrough') return 'na';
// Terminate: Central handles TLS — green if cert exists, red if missing
return certDomains.has(service.domain) ? 'ok' : 'error';
} }
function getProxyLabel(service: RegisteredService): string { function getProxyLabel(service: RegisteredService): string {