mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-07 14:01:36 +00:00
596d86a206
Adds continuous TLS endpoint health monitoring that closes the deploy→verify→monitor loop. After M25 verifies a deployment succeeded once, M48 continuously confirms it stays healthy. Key components: - Shared `internal/tlsprobe/` package extracted from network scanner for reuse - Health status state machine: healthy → degraded (2 failures) → down (5 failures), plus cert_mismatch when served fingerprint differs from expected - 8th scheduler loop (60s tick, per-endpoint configurable intervals) - PostgreSQL migration 000011: endpoint_health_checks + endpoint_health_history tables - 8 REST API endpoints (CRUD, history, acknowledge, summary) - Health Monitor GUI page with summary bar, status table, create modal, auto-refresh - 38 new tests (5 tlsprobe + 11 domain + 10 service + 8 handler + 4 frontend) - All coverage thresholds maintained (service 68%, handler 83%, domain 87%, middleware 63%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
const statusStyles: Record<string, string> = {
|
|
// Certificate statuses
|
|
Active: 'badge-success',
|
|
Expiring: 'badge-warning',
|
|
Expired: 'badge-danger',
|
|
RenewalInProgress: 'badge-info',
|
|
PendingIssuance: 'badge-info',
|
|
Archived: 'badge-neutral',
|
|
Revoked: 'badge-danger',
|
|
// Job statuses
|
|
Pending: 'badge-info',
|
|
AwaitingCSR: 'badge-info',
|
|
AwaitingApproval: 'badge-info',
|
|
Running: 'badge-warning',
|
|
Completed: 'badge-success',
|
|
Failed: 'badge-danger',
|
|
Cancelled: 'badge-neutral',
|
|
// Agent statuses
|
|
Online: 'badge-success',
|
|
Offline: 'badge-danger',
|
|
Stale: 'badge-warning',
|
|
// Discovery statuses
|
|
Unmanaged: 'badge-warning',
|
|
Managed: 'badge-success',
|
|
Dismissed: 'badge-neutral',
|
|
// Issuer statuses
|
|
Enabled: 'badge-success',
|
|
Disabled: 'badge-neutral',
|
|
// Notification statuses
|
|
sent: 'badge-success',
|
|
pending: 'badge-warning',
|
|
failed: 'badge-danger',
|
|
read: 'badge-neutral',
|
|
// Health check statuses
|
|
healthy: 'badge-success',
|
|
degraded: 'badge-warning',
|
|
down: 'badge-danger',
|
|
cert_mismatch: 'badge-warning',
|
|
unknown: 'badge-neutral',
|
|
};
|
|
|
|
export default function StatusBadge({ status }: { status: string }) {
|
|
const cls = statusStyles[status] || 'badge-neutral';
|
|
return <span className={`badge ${cls}`}>{status}</span>;
|
|
}
|