Skip to content
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

Add Fleet Management > Agents view #7283

Open
wants to merge 127 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
659c0f2
feat: copy the register agent assistant to wazuh-fleet plugin
Desvelao Feb 6, 2025
bfa8e94
Add rendering of views without indexer table and fix lint
yenienserrano Feb 6, 2025
7b053da
Add searchBar and some table components
yenienserrano Feb 7, 2025
d60b6af
Add sample data
yenienserrano Feb 10, 2025
9c0b1d6
Adding adapter and changing implementations by sample data
yenienserrano Feb 10, 2025
f258346
feat: add inputs to enrollment agent assistant
Desvelao Feb 11, 2025
c8edfb9
fix: prettier and eslint
Desvelao Feb 11, 2025
bbb9292
fix: eslint
Desvelao Feb 11, 2025
27324d4
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Feb 11, 2025
bb76a16
Changes and removing commented code
yenienserrano Feb 11, 2025
20bd093
Add table in group veiw
yenienserrano Feb 11, 2025
a05efa7
fix: install agent on Windows command
Desvelao Feb 12, 2025
0ade6b1
Remove unused code
yenienserrano Feb 12, 2025
b8b4662
Add render to Enrollment agent
yenienserrano Feb 12, 2025
2e455a0
Add agentManagement
yenienserrano Feb 12, 2025
3eb3722
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Feb 13, 2025
7d0fb01
Add getToasts and setToasts
yenienserrano Feb 12, 2025
1c48211
Add group update modal
yenienserrano Feb 12, 2025
eeeaf1c
Add upgrade modal
yenienserrano Feb 13, 2025
591c975
feat(enrollment): add ability to remember the server address
Desvelao Feb 13, 2025
beb18ff
feat(enrollment): rename Deploy new agent by Enroll new agent
Desvelao Feb 13, 2025
22b8646
remove(enrollment): remove enrollment.password setting by securiy rea…
Desvelao Feb 13, 2025
9bf7d5d
Merge branch 'main' of https://github.com/wazuh/wazuh-kibana-app into…
Desvelao Feb 13, 2025
f6db655
Add modals
yenienserrano Feb 13, 2025
793915f
Add mock to getAgents
yenienserrano Feb 13, 2025
428e096
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Feb 14, 2025
4d80439
fix(enrollment): windows command to install and enroll the agent
Desvelao Feb 14, 2025
8ace81e
fix: rename register-agent direcotry to enroll-agent
Desvelao Feb 14, 2025
8f692e9
fix(enrollment): rename register to enroll references
Desvelao Feb 14, 2025
fa5023d
fix(enrollment): rename register to enroll references
Desvelao Feb 14, 2025
4d40182
fix(enrollment): background color of copy overlay in dark mode
Desvelao Feb 14, 2025
5c7e396
Merge branch 'enhancement/514-add-enrollment-agent-assistant' of http…
Desvelao Feb 14, 2025
188a7a5
Add add mock and changes
yenienserrano Feb 14, 2025
cb4ef30
fix: remove a unused comment and enhance types
Desvelao Feb 17, 2025
58f4549
fix(enrollment): remove unused data from fetching Wazuh server API ve…
Desvelao Feb 17, 2025
0ff9276
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Feb 17, 2025
040ea27
Fix import RegisterAgent to EnrollAgent
yenienserrano Feb 17, 2025
d5851d2
fet(enrollment): add test toe nsure the step status
Desvelao Feb 17, 2025
1718a03
Add edit name modal
yenienserrano Feb 17, 2025
2f252d0
feat(enrollment): replace --register-agent flag to --enroll-agent
Desvelao Feb 17, 2025
f0bdd66
Add group editing of an agent
yenienserrano Feb 17, 2025
141a3e3
Merge branch 'main' into enhancement/514-add-enrollment-agent-assistant
Desvelao Feb 18, 2025
4522188
ci: add wazuh-fleet plugin
Desvelao Feb 18, 2025
6c1077f
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Feb 18, 2025
f34c60b
Fix lint
yenienserrano Feb 18, 2025
283fe60
chore: add entry to changelog
Desvelao Feb 19, 2025
70d457e
Merge branch 'main' of https://github.com/wazuh/wazuh-kibana-app into…
Desvelao Feb 19, 2025
d8436c7
docs: add fleet-management module
Desvelao Feb 19, 2025
240c301
docs(enrollment): add docs related to enrollment agent assistant
Desvelao Feb 19, 2025
415cb50
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Feb 19, 2025
5a44932
docs: add fleet management
Desvelao Feb 19, 2025
dedda97
Merge branch 'main' of https://github.com/wazuh/wazuh-kibana-app into…
Desvelao Feb 20, 2025
127ae90
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Feb 20, 2025
357ae38
Add edit, remove or add groups to one or more agents
yenienserrano Feb 20, 2025
7ebdd88
fix: missing i18n import
Desvelao Feb 21, 2025
112fed6
feat(agents): add management > agents app group
Desvelao Feb 21, 2025
a0a9df8
Merge branch 'enhancement/517-create-agent-management-apps' of https:…
Desvelao Feb 21, 2025
0ea65db
Fix agent navigation
yenienserrano Feb 24, 2025
4e86eba
Add upgrade global modal
yenienserrano Feb 24, 2025
80f69a8
fix(enrollment): replace --url by --enroll-url and add certificate va…
Desvelao Feb 26, 2025
c51a9cb
feat(enrollment): add communications URL to the enrollment assistant
Desvelao Feb 26, 2025
e2612f2
docs(enrollment): update enrollment assistant screenshot
Desvelao Feb 26, 2025
1243b68
Fix render badge filter
yenienserrano Feb 27, 2025
23edefd
Change useDefaultBehaviors: true
yenienserrano Feb 27, 2025
46ab96b
Tabs in agent detail removed until implementation of these views
yenienserrano Mar 5, 2025
2d70bfd
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Mar 5, 2025
be3abae
Fixed error when resolving conflicts
yenienserrano Mar 5, 2025
ad25a24
Resolves comments
yenienserrano Mar 6, 2025
c18f844
Add doc
yenienserrano Mar 6, 2025
2b18b81
change(enrollment): way to generate the install enrollment command (raw
Desvelao Mar 7, 2025
79b2530
Merge branch 'main' of https://github.com/wazuh/wazuh-kibana-app into…
Desvelao Mar 7, 2025
58e1450
Merge branch 'enhancement/514-add-enrollment-agent-assistant' into en…
yenienserrano Mar 7, 2025
92f46f3
Merge branch 'main' into enhancement/517-create-agent-management-apps
yenienserrano Mar 7, 2025
9591852
Improves agent summary documentation
guidomodarelli Mar 10, 2025
413c580
removes redundant assignment in constructor
guidomodarelli Mar 10, 2025
f3ad1a7
Refactors Agent interface and related types
guidomodarelli Mar 10, 2025
26c7304
Removes commented out dependencies
guidomodarelli Mar 10, 2025
cb6d1a6
Update type definitions for AgentDashboard props
guidomodarelli Mar 10, 2025
bc203c1
removes commented out code
guidomodarelli Mar 10, 2025
fd1f25f
Update types for filters and indexPattern in EventsCount
guidomodarelli Mar 10, 2025
1af4ff0
Refines types for AgentDetailsProps
guidomodarelli Mar 10, 2025
1e2a6c3
Updates agent source interface
guidomodarelli Mar 10, 2025
9c662df
Adds concurrency control to GitHub workflows
guidomodarelli Mar 10, 2025
845d566
Refactors group edit action handling
guidomodarelli Mar 10, 2025
72eaa49
update render prop type in ViewInterface
guidomodarelli Mar 10, 2025
e5f5e15
Enforces const assertion on EditActionGroups
guidomodarelli Mar 10, 2025
40c3ed7
Refactors search field setting logic
guidomodarelli Mar 10, 2025
b74fc70
Update plugins/wazuh-fleet/public/components/agents/list/actions/edit…
guidomodarelli Mar 10, 2025
19aae65
refactors risk level assignment in generateRandomHost
guidomodarelli Mar 10, 2025
e20fd9e
Update types for indexPatterns and filters
guidomodarelli Mar 10, 2025
8e0148f
Removes commented-out firewall monitoring code
guidomodarelli Mar 11, 2025
b9696b4
Removes unused variable in main script
guidomodarelli Mar 11, 2025
78bbbac
refactors URL generation for agent summary links
guidomodarelli Mar 11, 2025
505a3df
Merge branch 'main' into enhancement/517-create-agent-management-apps
guidomodarelli Mar 11, 2025
e4af947
simplifies breadcrumb logic in RouteComponent
guidomodarelli Mar 11, 2025
0922a70
remove document viewer component
guidomodarelli Mar 11, 2025
3329351
Update indexPatterns type in FleetManagementProps
guidomodarelli Mar 11, 2025
90bfe4e
Refactors agent response type
guidomodarelli Mar 11, 2025
2d46663
refactor search params direction type
guidomodarelli Mar 11, 2025
39cd3dc
Prevent page refresh when pressing enter on edit name input
yenienserrano Mar 11, 2025
fa61f5c
Add changelog
yenienserrano Mar 11, 2025
4415081
Merge branch 'main' into enhancement/517-create-agent-management-apps
yenienserrano Mar 17, 2025
60ad1a2
Integration of the query manager in the reading actions in wz-fleet (…
yenienserrano Mar 19, 2025
1418f2f
refactor(wazuh-fleet): streamline index pattern handling
yenienserrano Mar 20, 2025
ec8e90a
refactor(agent-management): simplify toast notifications and error ha…
yenienserrano Mar 20, 2025
c4f9e6d
refactor(agents): optimize group editing and agent reloading
yenienserrano Mar 20, 2025
d9d46c1
refactor(upgrade-agent-modal): simplify toast handling and extract pa…
yenienserrano Mar 20, 2025
1dab6bd
refactor(agents-list): extract agents data rendering logic into separ…
yenienserrano Mar 20, 2025
4988df3
refactor(table-indexer): improve type safety and code readability
yenienserrano Mar 20, 2025
7389512
refactor(agents): update reloadAgents and rename handleOnSave to hand…
yenienserrano Mar 20, 2025
d0d4a6b
refactor(agents-list): extract agents data and upgrade tasks logic in…
yenienserrano Mar 20, 2025
ffd4710
refactor(agents): rename and restructure save handler for clarity
yenienserrano Mar 20, 2025
23a2e06
refactor(date-range): move transformDateRange to utils module
yenienserrano Mar 20, 2025
6b93c4d
refactor(agents): use IAgentResponse type for better type safety
yenienserrano Mar 20, 2025
2807192
refactor(navigation): centralize navigation service in wazuh-core
yenienserrano Mar 20, 2025
ff9d1a7
ci: improve pre-commit hook logic and output
yenienserrano Mar 20, 2025
2258d2c
refactor(table-indexer): remove unused search-bar interface file
yenienserrano Mar 20, 2025
b416dd5
refactor(edit-name-agent-modal): add isValid flag for name validation
yenienserrano Mar 21, 2025
8331ebd
Refactors error message handling in agent name validation
guidomodarelli Mar 21, 2025
d6602b6
refactors agent name validation constants
guidomodarelli Mar 21, 2025
80dbc76
simplifies validation state handling in EditAgentNameModal
guidomodarelli Mar 21, 2025
e8bba67
refactor(visualizations): rename and reorder visualization functions …
yenienserrano Mar 26, 2025
6334779
feat(agents-list): add 'View agent tasks' action to agents table
yenienserrano Mar 26, 2025
7c2b165
feat(agent-upgrade): add version selection for agent upgrade
yenienserrano Mar 27, 2025
aed1329
feat(edit-groups-modal): disable save button when groups are unchanged
yenienserrano Mar 31, 2025
b7e792c
feat(agents): add and update tests for agent management components
yenienserrano Mar 31, 2025
e018592
Change basic table to data grid
Machi3mfl Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: prettier and eslint
  • Loading branch information
Desvelao committed Feb 11, 2025
commit c8edfb9a13b4f2d76ac58d85eaa528bb08b32f62
Original file line number Diff line number Diff line change
@@ -23,6 +23,19 @@ enum EpluginSettingType { // eslint-disable-next-line @typescript-eslint/naming-
custom = 'custom', // eslint-disable-next-line @typescript-eslint/naming-convention
}

const getValueFromEventType: IgetValueFromEventType = {
[EpluginSettingType.switch]: (event: any) => event.target.checked,
[EpluginSettingType.editor]: (value: any) => value,
[EpluginSettingType.filepicker]: (value: any) => value,
[EpluginSettingType.select]: (event: any) => event.target.value,
[EpluginSettingType.text]: (event: any) => event.target.value,
[EpluginSettingType.textarea]: (event: any) => event.target.value,
[EpluginSettingType.number]: (event: any) => event.target.value,
[EpluginSettingType.password]: (event: any) => event.target.value,
custom: (event: any) => event.target.value,
default: (event: any) => event.target.value,
};

/**
* Returns the value of the event according to the type of field
* When the type is not found, it returns the value defined in the default key
@@ -38,19 +51,6 @@ function getValueFromEvent(
return (getValueFromEventType[type] || getValueFromEventType.default)(event);
}

const getValueFromEventType: IgetValueFromEventType = {
[EpluginSettingType.switch]: (event: any) => event.target.checked,
[EpluginSettingType.editor]: (value: any) => value,
[EpluginSettingType.filepicker]: (value: any) => value,
[EpluginSettingType.select]: (event: any) => event.target.value,
[EpluginSettingType.text]: (event: any) => event.target.value,
[EpluginSettingType.textarea]: (event: any) => event.target.value,
[EpluginSettingType.number]: (event: any) => event.target.value,
[EpluginSettingType.password]: (event: any) => event.target.value,
custom: (event: any) => event.target.value,
default: (event: any) => event.target.value,
};

export function getFormFields(fields) {
return Object.fromEntries(
Object.entries(fields).map(([fieldKey, fieldConfiguration]) => [
@@ -93,6 +93,7 @@ export function enhanceFormFields(
pathFormFieldParent = [],
},
) {
// eslint-disable-next-line unicorn/no-array-reduce
return Object.entries(formFields).reduce(
(accum, [fieldKey, { currentValue: value, ...restFieldState }]) => {
// Define the path to fields object
@@ -186,6 +187,7 @@ export function mapFormFields(
},
callbackFormField,
) {
// eslint-disable-next-line unicorn/no-array-reduce
return Object.entries(formState).reduce((accum, [key, value]) => {
const pathField = [...pathFieldFormDefinition, key];
const fieldDefinition = get(formDefinition, pathField);
@@ -243,9 +245,15 @@ export const useForm = (fields: FormConfiguration): UseFormReturn => {
pathFieldFormDefinition: [],
pathFormState: [],
},
// eslint-disable-next-line @typescript-eslint/no-unused-vars
({ changed, error, value }, _, { pathFormState, fieldDefinition }) => {
changed && (result.changed[pathFormState] = value);
error && (result.errors[pathFormState] = error);
if (changed) {
result.changed[pathFormState] = value;
}

if (error) {
result.errors[pathFormState] = error;
}
},
);

Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
import React from 'react';
import { InputFormEditor } from './input_editor';
import { InputFormNumber } from './input_number';
import { InputFormText } from './input_text';
import { InputFormSelect } from './input_select';
import { InputFormSwitch } from './input_switch';
import { InputFormFilePicker } from './input_filepicker';
import { InputFormTextArea } from './input_text_area';
import { EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui';
import { InputFormEditor } from './input-editor';
import { InputFormNumber } from './input-number';
import { InputFormText } from './input-text';
import { InputFormSelect } from './input-select';
import { InputFormSwitch } from './input-switch';
import { InputFormFilePicker } from './input-filepicker';
import { InputFormTextArea } from './input-textarea';
import { SettingTypes } from './types';
import { InputFormPassword } from './input-password';

const Input = {
switch: InputFormSwitch,
editor: InputFormEditor,
filepicker: InputFormFilePicker,
number: InputFormNumber,
select: InputFormSelect,
text: InputFormText,
textarea: InputFormTextArea,
password: InputFormPassword,
custom: ({ component, ...rest }) => component(rest),
};

export interface InputFormProps {
type: SettingTypes;
value: any;
@@ -55,7 +67,6 @@ export const InputForm = ({
}

const isInvalid = Boolean(error);

const input = (
<ComponentInput
{...rest}
@@ -85,15 +96,3 @@ export const InputForm = ({
input
);
};

const Input = {
switch: InputFormSwitch,
editor: InputFormEditor,
filepicker: InputFormFilePicker,
number: InputFormNumber,
select: InputFormSelect,
text: InputFormText,
textarea: InputFormTextArea,
password: InputFormPassword,
custom: ({ component, ...rest }) => component(rest),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { EuiCodeEditor } from '@elastic/eui';
import { IInputFormType } from './types';

export const InputFormEditor = ({
options,
value,
onChange,
}: IInputFormType) => (
<EuiCodeEditor
mode={options.editor.language}
height='50px'
width='100%'
value={value}
onChange={onChange}
/>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import { EuiFilePicker } from '@elastic/eui';
import { IInputFormType } from './types';

export const InputFormFilePicker = ({
onChange,
options,
setInputRef,
key,
...rest
}: IInputFormType) => (
<EuiFilePicker
id={key}
initialPromptText='Select or drag the file'
onChange={fileList =>
onChange(
// File was added.
fileList?.[0] ||
// File was removed. We set the initial value, so the useForm hook will not detect any change. */
rest.initialValue,
)
}
display='default'
fullWidth
aria-label='Upload a file'
accept={options.file.extensions.join(',')}
ref={setInputRef}
/>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { EuiFieldNumber } from '@elastic/eui';
import { IInputFormType } from './types';

export const InputFormNumber = ({
options,
value,
onChange,
}: IInputFormType) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { integer, ...rest } = options?.number || {};

return (
<EuiFieldNumber fullWidth value={value} onChange={onChange} {...rest} />
);
};
Original file line number Diff line number Diff line change
@@ -9,15 +9,13 @@ export const InputFormPassword = ({
placeholder,
fullWidth,
options,
}: IInputFormType) => {
return (
<EuiFieldPassword
fullWidth={typeof fullWidth === 'undefined' ? true : fullWidth}
value={value}
isInvalid={isInvalid}
onChange={onChange}
placeholder={placeholder}
type={options?.password?.type || 'dual'}
/>
);
};
}: IInputFormType) => (
<EuiFieldPassword
fullWidth={fullWidth === undefined ? true : fullWidth}
value={value}
isInvalid={isInvalid}
onChange={onChange}
placeholder={placeholder}
type={options?.password?.type || 'dual'}
/>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { EuiSelect } from '@elastic/eui';
import { IInputFormType } from './types';

export const InputFormSelect = ({
options,
value,
onChange,
placeholder,
dataTestSubj,
}: IInputFormType) => (
<EuiSelect
options={options.select}
value={value}
onChange={onChange}
placeholder={placeholder}
data-test-subj={dataTestSubj}
/>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { EuiSwitch } from '@elastic/eui';
import { IInputFormType } from './types';

export const InputFormSwitch = ({
options,
value,
onChange,
}: IInputFormType) => {
const checked = Object.entries(options.switch.values).find(
([, { value: statusValue }]) => value === statusValue,
)[0];

return (
<EuiSwitch
label={options.switch.values[value ? 'enabled' : 'disabled'].label}
checked={checked === 'enabled'}
onChange={onChange}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { EuiFieldText } from '@elastic/eui';
import { IInputFormType } from './types';

export const InputFormText = ({
value,
isInvalid,
onChange,
placeholder,
fullWidth,
}: IInputFormType) => (
<EuiFieldText
fullWidth={fullWidth === undefined ? true : fullWidth}
value={value}
isInvalid={isInvalid}
onChange={onChange}
placeholder={placeholder}
/>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { EuiTextArea } from '@elastic/eui';
import { IInputFormType } from './types';

export const InputFormTextArea = ({
value,
isInvalid,
onChange,
options,
}: IInputFormType) => (
<EuiTextArea
fullWidth
value={value}
isInvalid={isInvalid}
onChange={onChange}
rows={options?.maxRows}
/>
);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading