-
Notifications
You must be signed in to change notification settings - Fork 197
Add Fleet Management > Agents view #7283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
asteriscos
merged 204 commits into
main
from
enhancement/517-create-agent-management-apps
Apr 14, 2025
Merged
Add Fleet Management > Agents view #7283
asteriscos
merged 204 commits into
main
from
enhancement/517-create-agent-management-apps
Apr 14, 2025
Conversation
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
- Copy the register-agent folder from wazuh plugin to wazuh-fleet - Add the webDocumentationLink and form components/hook to register-agent copy - Register minimal Fleet management app to display the register agent assistant view
Added: - Added inputs to match with the `wazuh-agent` cli: - Input to manage the username - Input to manage the password - Input to manage the SSL verification mode - Input to manage the key (This key must have 32 alphanumeric characters validation) - Added new step "Server credentials" to define the username and password - Added tests for the new inputs Changed: - Changed the generation of command to install and enroll the agent - Changed the validation of "Assign a server address" input - Changed the placeholder of "Assign a server address" input - Changed the description of "Server address" step to indicate the usage of URL instead of raw IP or FQDNS Removed: - Groups management was removed because the current Wazuh agent enrollment does not support the definition of these. - Removed groups form input - Removed fetch information about available groups - Removed fetch information about authentication password provided through the Wazuh server API - Removed fetch information about protocol provided through the Wazuh server API - Temporally: - The command to download the package were temporaly removed because the packages are not publically hosted. A warning message was added to inform about this.
…hancement/517-create-agent-management-apps
…hancement/517-create-agent-management-apps
…sons The setting is saved in the advanced settings (tenant configuration) and is visible to each user with read permissions in the tenant. So we remove the setting to avoid other users can see the value. The user should indicate the username and password each time the enroll agent assistant is used.
… enhancement/514-add-enrollment-agent-assistant
…hancement/517-create-agent-management-apps
Updates the test configuration to enable coverage collection only when running in a CI environment. Prevents unnecessary coverage reporting during local development.
Introduces a localStorage mock to facilitate testing components relying on localStorage API. Updates Jest configuration to include the mock setup file in test initialization for consistent test behavior.
Refactors multiple localStorage-based state managers into a single, unified manager. Simplifies key generation by removing unnecessary parameters. Updates tests to align with the new structure and validation logic. Improves state validation for columns, widths, and page size. Enhances maintainability and reduces redundancy in state management.
Unifies column and column-width state management into a single persistence manager for consistency and maintainability. Replaces `appId` with `moduleId` for improved clarity. Updates function names and test cases to align with the new state management approach. Simplifies and consolidates validation and retrieval logic. Enhances code readability and reduces duplication.
Replaces TDataGridColumn with DataGridColumn across components for consistency and clarity. Introduces DataGridRenderColumn type for enhanced type definition. Updates tests and imports accordingly to align with changes.
Initializes pagination with `pageSize = 0` to avoid conflicts between local state and internal hooks, reducing multiple redundant fetches. Adds a conditional check to ensure data is only fetched once a valid `pageSize` is set. Replaces hardcoded page size options with a constant for consistency.
Replaces references to moduleId with appId for consistency across components. Updates hook logic, state management, and dependencies accordingly. Simplifies and removes redundant tests related to column rendering.
Migrates data grid logic to TypeScript for improved type safety Introduces state persistence manager for column and pagination settings Sanitizes rendered cell values for enhanced security Simplifies and optimizes pagination and sorting logic Improves column schema handling with memoized methods
Replaces the boolean-based reload logic with an RxJS Subject for triggering component refreshes. Improves code readability and reduces state management complexity by using observables. Enhances maintainability and aligns with reactive programming patterns.
Refactors initialization of pagination state to use a dedicated type. Removes unnecessary use of 'as const' in constants for improved readability. Ensures consistent handling of page size defaults in the data grid logic.
Refactors state persistence logic to ensure invalid state resets are persisted. Updates tests to reflect changes in state retrieval behavior. Enhances reliability and consistency of state management.
Renames the "columnsWidth" property to "columnWidths" across codebase for improved clarity and consistency. Updates related type definitions, logic, and test cases to reflect the new naming convention.
Ensures rows are always parsed into an array for consistency. Updates row index validation to use a safer boundary check. Improves reliability of data handling for pagination.
Wraps column schema definitions in a shallow copy to prevent unintended mutations when processing visible columns in the data grid.
Introduces `indexPatternExists` property to ensure operations depend on the presence of an index pattern. Updates validation logic, state persistence, and column handling to bypass processing when the index pattern is missing, improving stability and preventing unnecessary operations.
Includes the indexPatternExists parameter in multiple test cases to ensure proper coverage and handling of scenarios where index patterns exist.
Replaces moduleId with appId in test cases for consistency. Adds indexPatternExists parameter to improve test coverage and alignment with updated function requirements.
Refactors agent reloading logic to use a reactive pattern with subscriptions. Replaces `reloadAgents` callbacks with direct calls to `refresh$.next()`. Adds a `useEffect` hook to manage subscription lifecycle and ensure cleanup. Improves code clarity and ensures consistent state updates.
Verify that one request is made to the Indexer, ensuring that unnecessary calls are not generated.Screen.Recording.2025-04-11.161143.mp4 |
Replaces the agent summary diagram with a new version to reflect updated information or design changes for improved clarity.
This reverts commit a2ee869.
|
|
|
Desvelao
approved these changes
Apr 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
guidomodarelli
approved these changes
Apr 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🟢
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.
Description
Adds rendering of fleet management summary and detail views
Added the script to generate sample data of
wazuh-agents*
with this templateIssues Resolved
Evidence
Edit group
Screen.Recording.2025-02-20.at.5.34.53.PM.mov
Test
Check that the interface is visible, you can add sample data of the agents from the script (The table is using information from the indexer but the other actions are mocked up.)
Verify that one request is made to the Indexer, ensuring that unnecessary calls are not generated.
Check List