fix(ui): replace TLS badge with icon-only indicator
Full-text badge ("Plain-Text (Insecure)") replaced with a colored
shield icon — green/yellow/red by TLS mode. Label available on
hover via title attribute. Universal lock convention, no label needed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -188,34 +188,17 @@ function EditDeviceDialog({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function TlsSecurityBadge({ tlsMode }: { tlsMode: string }) {
|
function TlsSecurityBadge({ tlsMode }: { tlsMode: string }) {
|
||||||
const config: Record<string, { label: string; icon: React.ElementType; className: string }> = {
|
const config: Record<string, { label: string; icon: React.ElementType; color: string }> = {
|
||||||
portal_ca: {
|
portal_ca: { label: 'CA Verified', icon: ShieldCheck, color: 'text-success' },
|
||||||
label: 'CA Verified',
|
auto: { label: 'Self-Signed TLS', icon: Shield, color: 'text-warning' },
|
||||||
icon: ShieldCheck,
|
insecure: { label: 'Insecure TLS', icon: ShieldAlert, color: 'text-warning' },
|
||||||
className: 'text-success border-success/50 bg-success/10',
|
plain: { label: 'Plain-Text', icon: ShieldOff, color: 'text-error' },
|
||||||
},
|
|
||||||
auto: {
|
|
||||||
label: 'Self-Signed TLS',
|
|
||||||
icon: Shield,
|
|
||||||
className: 'text-warning border-warning/50 bg-warning/10',
|
|
||||||
},
|
|
||||||
insecure: {
|
|
||||||
label: 'Insecure TLS',
|
|
||||||
icon: ShieldAlert,
|
|
||||||
className: 'text-orange-400 border-orange-400/50 bg-orange-400/10',
|
|
||||||
},
|
|
||||||
plain: {
|
|
||||||
label: 'Plain-Text (Insecure)',
|
|
||||||
icon: ShieldOff,
|
|
||||||
className: 'text-error border-error/50 bg-error/10',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
const c = config[tlsMode] ?? config.auto
|
const c = config[tlsMode] ?? config.auto
|
||||||
const Icon = c.icon
|
const Icon = c.icon
|
||||||
return (
|
return (
|
||||||
<span className={cn('inline-flex items-center gap-1.5 text-xs px-2 py-1 rounded border', c.className)}>
|
<span className={cn('flex-shrink-0', c.color)} title={c.label}>
|
||||||
<Icon className="h-3 w-3" />
|
<Icon className="h-3 w-3" />
|
||||||
{c.label}
|
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user