Use warning variant for service badges that indicate a problem
Distinguish between "disabled" (opt-in feature intentionally off, gray) and "stopped" (expected service not running, yellow warning). Core services like DNS, HAProxy, CrowdSec show warning when stopped. Opt-in features like VPN and firewall show warning only when enabled in config but not actually running. Opt-in features that are simply disabled stay gray (secondary). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -227,7 +227,7 @@ export function CrowdSecComponent() {
|
||||
{isLoadingStatus ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin text-muted-foreground" />
|
||||
) : (
|
||||
<Badge variant={status?.active ? 'success' : 'secondary'} className="gap-1">
|
||||
<Badge variant={status?.active ? 'success' : 'warning'} className="gap-1">
|
||||
{status?.active && <CheckCircle className="h-3 w-3" />}
|
||||
{status?.active ? 'Running' : 'Stopped'}
|
||||
</Badge>
|
||||
@@ -250,7 +250,7 @@ export function CrowdSecComponent() {
|
||||
<span>Perimeter firewall enforcement</span>
|
||||
<span className="text-xs text-muted-foreground">(nftables on Wild Central)</span>
|
||||
</div>
|
||||
<Badge variant={status.firewallBouncer ? 'success' : 'secondary'} className="gap-1">
|
||||
<Badge variant={status.firewallBouncer ? 'success' : 'warning'} className="gap-1">
|
||||
{status.firewallBouncer && <CheckCircle className="h-3 w-3" />}
|
||||
{status.firewallBouncer ? 'Active' : 'Stopped'}
|
||||
</Badge>
|
||||
|
||||
@@ -175,7 +175,7 @@ export function DnsComponent() {
|
||||
<Router className="h-5 w-5 text-muted-foreground" />
|
||||
<CardTitle>LAN DNS</CardTitle>
|
||||
</div>
|
||||
<Badge variant={isDnsRunning ? 'success' : 'secondary'} className="gap-1">
|
||||
<Badge variant={isDnsRunning ? 'success' : 'warning'} className="gap-1">
|
||||
{isDnsStatusLoading ? (
|
||||
<Loader2 className="h-3 w-3 animate-spin" />
|
||||
) : isDnsRunning ? (
|
||||
|
||||
@@ -494,7 +494,7 @@ export function FirewallComponent() {
|
||||
{isNftablesLoading ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin text-muted-foreground" />
|
||||
) : (
|
||||
<Badge variant={nftablesStatus?.rules ? 'success' : 'secondary'} className="gap-1">
|
||||
<Badge variant={nftablesStatus?.rules ? 'success' : isEnabled ? 'warning' : 'secondary'} className="gap-1">
|
||||
{nftablesStatus?.rules && <CheckCircle className="h-3 w-3" />}
|
||||
{nftablesStatus?.rules ? 'Active' : 'Not loaded'}
|
||||
</Badge>
|
||||
|
||||
@@ -137,7 +137,7 @@ export function IngressProxyComponent() {
|
||||
{isHaproxyLoading ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin text-muted-foreground" />
|
||||
) : (
|
||||
<Badge variant={haproxyStatus?.status === 'active' ? 'success' : 'secondary'} className="gap-1">
|
||||
<Badge variant={haproxyStatus?.status === 'active' ? 'success' : 'warning'} className="gap-1">
|
||||
{haproxyStatus?.status === 'active' && <CheckCircle className="h-3 w-3" />}
|
||||
{haproxyStatus?.status === 'active' ? 'Active' : haproxyStatus?.status ?? 'Stopped'}
|
||||
</Badge>
|
||||
|
||||
@@ -105,7 +105,7 @@ export function LanDnsComponent() {
|
||||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<CardTitle>DNS Service</CardTitle>
|
||||
<Badge variant={isDnsRunning ? 'success' : 'secondary'} className="gap-1">
|
||||
<Badge variant={isDnsRunning ? 'success' : 'warning'} className="gap-1">
|
||||
{isDnsStatusLoading ? (
|
||||
<Loader2 className="h-3 w-3 animate-spin" />
|
||||
) : isDnsRunning ? (
|
||||
|
||||
@@ -202,7 +202,7 @@ export function VpnComponent() {
|
||||
<div className="flex items-center justify-between">
|
||||
<CardTitle>Status</CardTitle>
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge variant={status?.running ? 'success' : 'secondary'} className="gap-1">
|
||||
<Badge variant={status?.running ? 'success' : config?.enabled ? 'warning' : 'secondary'} className="gap-1">
|
||||
{status?.running && <CheckCircle className="h-3 w-3" />}
|
||||
{status?.running ? 'Running' : 'Stopped'}
|
||||
</Badge>
|
||||
|
||||
Reference in New Issue
Block a user