fix: resolve CrowdSec state sync issues and remove deprecated mode toggle
- Backend: Start/Stop handlers now sync both settings and security_configs tables - Frontend: CrowdSec toggle uses actual process status (crowdsecStatus.running) - Frontend: Fixed LiveLogViewer WebSocket race condition by using isPausedRef - Frontend: Removed deprecated mode toggle from CrowdSecConfig page - Frontend: Added info banner directing users to Security Dashboard - Frontend: Added "Start CrowdSec" button to enrollment warning panel Fixes dual-source state conflict causing toggle to show incorrect state. Fixes live log "disconnected" status appearing while logs stream. Simplifies CrowdSec control to single source (Security Dashboard toggle). Includes comprehensive test updates for new architecture.
This commit is contained in:
@@ -75,23 +75,12 @@ describe('CrowdSecConfig', () => {
|
||||
vi.spyOn(HTMLAnchorElement.prototype, 'click').mockImplementation(() => {})
|
||||
})
|
||||
|
||||
it('toggles mode between local and disabled', async () => {
|
||||
it('shows info banner directing to Security Dashboard', async () => {
|
||||
renderWithProviders()
|
||||
|
||||
await waitFor(() => screen.getByTestId('crowdsec-mode-toggle'))
|
||||
const toggle = screen.getByTestId('crowdsec-mode-toggle')
|
||||
|
||||
await userEvent.click(toggle)
|
||||
|
||||
await waitFor(() => {
|
||||
expect(settingsApi.updateSetting).toHaveBeenCalledWith(
|
||||
'security.crowdsec.mode',
|
||||
'disabled',
|
||||
'security',
|
||||
'string'
|
||||
)
|
||||
expect(toast.success).toHaveBeenCalledWith('CrowdSec disabled')
|
||||
})
|
||||
await waitFor(() => screen.getByText(/CrowdSec is controlled via the toggle on the/i))
|
||||
expect(screen.getByText(/Security Dashboard/i)).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: /Security Dashboard/i })).toHaveAttribute('href', '/security')
|
||||
})
|
||||
|
||||
it('exports configuration packages with prompted filename', async () => {
|
||||
|
||||
Reference in New Issue
Block a user