diff --git a/web/components/server/server-security-page.tsx b/web/components/server/server-security-page.tsx index c56039a9..d06d0217 100644 --- a/web/components/server/server-security-page.tsx +++ b/web/components/server/server-security-page.tsx @@ -1,12 +1,12 @@ "use client"; import { - type Activity, AlertTriangle, Ban, CheckCircle2, Clock3, Database, + type LucideIcon, Radio, ShieldCheck, XCircle, @@ -103,29 +103,24 @@ function getOverallState( return "healthy"; } -function ComponentCard({ +function ComponentStatus({ title, - description, available, icon: Icon, children, }: { title: string; - description: string; available: boolean; - icon: typeof Activity; + icon: LucideIcon; children?: React.ReactNode; }) { return ( - - -
- - - {description} -
+
+
+

+

- - {children && {children}} - +
+ {children} +
); } @@ -216,64 +211,60 @@ export function ServerSecurityPage({
- - Last checked: -
-
- - -
- {[ - ["Read", health?.metrics.reads], - ["Parsed", health?.metrics.parsed], - ["Unparsed", health?.metrics.unparsed], - ].map(([label, value]) => ( -
-
{label}
-
- {value ?? "—"} -
+ + + + +
+ {[ + ["Read", health?.metrics.reads], + ["Parsed", health?.metrics.parsed], + ["Unparsed", health?.metrics.unparsed], + ].map(([label, value]) => ( +
+
{label}
+
+ {value ?? "—"} +
+
+ ))} +
+
+ +
+
+
Registration
+
{bouncerRegistration}
- ))} -
- - -
-
-
Registration
-
{bouncerRegistration}
-
-
-
Last decision pull
-
- -
-
- {health?.bouncer.error && ( -
- {formatBouncerError(health.bouncer.error)} +
+
Last decision pull
+
+ +
- )} -
-
-
+ {health?.bouncer.error && ( +
+ {formatBouncerError(health.bouncer.error)} +
+ )} +
+ + + +
- + @@ -365,16 +356,16 @@ function DecisionRows({ records }: { records: CrowdSecDecision[] }) { {records.map((record, index) => ( - - - - - + + + @@ -387,10 +378,10 @@ function DecisionRows({ records }: { records: CrowdSecDecision[] }) { function AlertRows({ records }: { records: CrowdSecAlert[] }) { return ( -
+
Active CrowdSec blocks
Target Action
+ {record.scope}
{record.value}
{record.action}{record.reason || "—"}{record.origin || "—"} + {record.action}{record.reason || "—"}{record.origin || "—"}
- + @@ -402,13 +393,13 @@ function AlertRows({ records }: { records: CrowdSecAlert[] }) { {records.map((record) => ( - - - - - + + +
Recent CrowdSec threats
Detected Scenario
+ {record.scenario || "—"}{record.sourceIp || "—"}{record.country || "—"} + {record.scenario || "—"}{record.sourceIp || "—"}{record.country || "—"} {record.eventCount}