Add alerts and collections pages#177
Open
stephdl wants to merge 21 commits into
Open
Conversation
1dbda7b to
8885e39
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds two new UI pages to the NS8 CrowdSec module (Alerts and Collections) and introduces the corresponding backend actions to list/inspect/delete alerts and list/toggle collections.
Changes:
- Added Alerts page with listing, inspection modal, and “delete all alerts” flow.
- Added Collections page with list + enable/disable (toggle) flow and confirmation modal.
- Added backend actions (with JSON schema validation where applicable) to support the new UI.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/views/Collections.vue | New Collections page with list + toggle flow and Hub link notification |
| ui/src/views/Alerts.vue | New Alerts page with list, inspect modal, and delete-all flow |
| ui/src/router/index.js | Adds routes for /alerts and /collections |
| ui/src/components/InspectAlertModal.vue | New modal to show alert details and event list |
| ui/src/components/ConfirmToggleCollectionModal.vue | New confirmation modal for collection enable/disable |
| ui/src/components/ConfirmDeleteAlertsModal.vue | New confirmation modal for deleting all alerts |
| ui/src/components/AppSideMenuContent.vue | Adds side menu links for Collections and Alerts |
| ui/public/i18n/en/translation.json | Adds i18n keys for Alerts/Collections UI and new action names |
| imageroot/actions/toggle-collection/validate-input.json | Input schema for toggle-collection action |
| imageroot/actions/toggle-collection/10toggle-collection | Backend action to install/remove a collection and reload |
| imageroot/actions/list-collections/validate-output.json | Output schema for list-collections action |
| imageroot/actions/list-collections/10list-collections | Backend action to list collections (JSON) |
| imageroot/actions/list-alerts/validate-output.json | Output schema for list-alerts action |
| imageroot/actions/list-alerts/10list-alerts | Backend action to list alerts (JSON) |
| imageroot/actions/inspect-alert/validate-input.json | Input schema for inspect-alert action |
| imageroot/actions/inspect-alert/10inspect-alert | Backend action to inspect an alert by id (JSON) |
| imageroot/actions/delete-alerts/validate-output.json | Output schema for delete-alerts action |
| imageroot/actions/delete-alerts/10flush-alerts | Backend action to delete all alerts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a6c7a66 to
a321087
Compare
…ommunity blocklist
… for confirming deletion and toggling collections
…bles - Implemented the Alerts view with a data table for displaying alerts, including functionalities for listing, inspecting, and deleting alerts. - Created the Capi view to show the status of CAPI connections, including search functionality for IP addresses and displaying relevant notifications. - Developed the Collections view to manage collections with a data table, allowing users to enable/disable collections and view their statuses. - Added modals for confirming actions in both the Collections and Alerts views. - Enhanced the Settings view to include a toggle for pulling the community blocklist. - Updated the Status view to improve service status display and added a computed property for failed services.
f0766ff to
09e7f06
Compare
When CAPI is fully disabled, cscli exits non-zero with 'no configuration'. Capture output with || true so set -e does not abort the script. Also match 'no configuration' in the config_disabled check.
…nput validation schema
862422b to
e156158
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add three new pages to the CrowdSec module: Alerts, Collections, and Central API (CAPI). Also extend the existing backend to support these views.
Alerts page
cscli alerts delete --allCollections page
local_version), Descriptioncscli collections install|removethen sends SIGHUP to reload--allflag to list both enabled and disabled collectionsCentral API (CAPI) page
cscli decisions listagainst the CAPI blocklistBackend actions (new)
list-alerts—cscli alerts list --output jsoninspect-alert—cscli alerts inspect <id> --output jsondelete-alerts—cscli alerts delete --alllist-collections—cscli collections list --all --output jsontoggle-collection—cscli collections install|remove <name>+kill -HUP 1get-capi-status— parsescscli capi statusplain-text output (JSON flag ignored by cscli)get-capi-count— counts CAPI decisions viacscli decisions list --origin CAPIsearch-capi-decision— searches CAPI decisions for a given IPBackend changes (existing)
configure-module: added79cleanup-capistep that purges CAPI decisions when the Central API or community blocklist pull is disabledget-configuration: exposesenable_online_apiflag derived from theDISABLE_ONLINE_APIenv varSettings page
Side menu
Reordered: Status → Settings → Collections → Alerts → Banned IP → About
i18n
All new keys added to the English locale (
en/translation.json).