Skip to content

Commit 92f46f3

Browse files
Merge branch 'main' into enhancement/517-create-agent-management-apps
2 parents 58e1450 + b1f386c commit 92f46f3

File tree

1 file changed

+32
-0
lines changed
  • plugins/wazuh-fleet/public/application

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { setEnrollAgentManagement } from '../plugin-services';
2+
import { AppSetup } from './types';
3+
4+
export function appSetup({ registerApp, enrollmentAgentManagement }: AppSetup) {
5+
registerApp({
6+
id: 'wazuh-fleet',
7+
title: 'Fleet management',
8+
order: 1,
9+
mount: async (params: AppMountParameters) => {
10+
try {
11+
// Load application bundle
12+
const { renderApp } = await import('./render-app');
13+
14+
params.element.classList.add('dscAppWrapper', 'wz-app');
15+
16+
const unmount = await renderApp(params);
17+
18+
return () => {
19+
unmount();
20+
};
21+
} catch (error) {
22+
console.debug(error);
23+
}
24+
},
25+
// category: Categories.find(
26+
// ({ id: categoryID }) => categoryID === category,
27+
// ),
28+
});
29+
30+
// TODO: This setter should be local to fleet management instead of using the related to the plugin itself. This approach was done because the integration of FleetManagement is using another setter from plugin-services.
31+
setEnrollAgentManagement(enrollmentAgentManagement);
32+
}

0 commit comments

Comments
 (0)