From 41f68bdbdbf7ba0e0f8bd91c9592256fa76dfc64 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sun, 30 Nov 2025 21:24:34 +0000 Subject: [PATCH] refactor: remove CrowdSec control from SystemSettings page; move to Security page --- frontend/src/pages/SystemSettings.tsx | 65 +-------------------------- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/frontend/src/pages/SystemSettings.tsx b/frontend/src/pages/SystemSettings.tsx index bc2780bf..70ccb83d 100644 --- a/frontend/src/pages/SystemSettings.tsx +++ b/frontend/src/pages/SystemSettings.tsx @@ -8,7 +8,7 @@ import { toast } from '../utils/toast' import { getSettings, updateSetting } from '../api/settings' import { getFeatureFlags, updateFeatureFlags } from '../api/featureFlags' import client from '../api/client' -import { startCrowdsec, stopCrowdsec, statusCrowdsec, importCrowdsecConfig, exportCrowdsecConfig } from '../api/crowdsec' +// CrowdSec runtime control is now in the Security page import { Loader2, Server, RefreshCw, Save, Activity } from 'lucide-react' interface HealthResponse { @@ -107,33 +107,7 @@ export default function SystemSettings() { }) // CrowdSec control - const [crowdsecStatus, setCrowdsecStatus] = useState<{ running: boolean; pid?: number } | null>(null) - const fetchCrowdsecStatus = async () => { - try { - const s = await statusCrowdsec() - setCrowdsecStatus(s) - } catch { - setCrowdsecStatus(null) - } - } - - useEffect(() => { fetchCrowdsecStatus() }, []) - - const startMutation = useMutation({ mutationFn: () => startCrowdsec(), onSuccess: () => fetchCrowdsecStatus(), onError: (e: unknown) => toast.error(String(e)) }) - const stopMutation = useMutation({ mutationFn: () => stopCrowdsec(), onSuccess: () => fetchCrowdsecStatus(), onError: (e: unknown) => toast.error(String(e)) }) - - const importMutation = useMutation({ - mutationFn: async (file: File) => importCrowdsecConfig(file), - onSuccess: () => { toast.success('CrowdSec config imported'); fetchCrowdsecStatus() }, - onError: (e: unknown) => toast.error(String(e)), - }) - - const handleCrowdsecUpload = (e: React.ChangeEvent) => { - const f = e.target.files?.[0] - if (!f) return - importMutation.mutate(f) - } return (
@@ -344,44 +318,7 @@ export default function SystemSettings() {
- {/* CrowdSec Controls */} - -

CrowdSec

-
-
-
-

Status

-

{crowdsecStatus ? (crowdsecStatus.running ? `Running (pid ${crowdsecStatus.pid})` : 'Stopped') : 'Unknown'}

-
-
- - - -
-
-
- - -

Upload a tar.gz or zip with your CrowdSec configuration. Existing config will be backed up.

-
-
-
) }