Skip to content

Commit

Permalink
Add rules views
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano committed Jan 17, 2025
1 parent b718539 commit c78abd9
Show file tree
Hide file tree
Showing 4 changed files with 860 additions and 3 deletions.
20 changes: 17 additions & 3 deletions plugins/wazuh-security-policies/public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
import { Router, Route, Switch, Redirect, useParams } from 'react-router-dom';
import { getCore, getHistory } from '../plugin-services';
import { IntegrationOverview } from './integretions/overview';
import { IntegrationView } from './integretions/integration';
import { IntegrationView } from './integretions/integration-details';
import { RulesOverview } from './rules/overview';
import { RuleDetails } from './rules/rule-details';

interface ViewInterface {
name: string;
Expand All @@ -29,7 +31,8 @@ const views: ViewInterface[] = [
{
name: 'Rules',
id: 'rules',
render: () => <div>Rules</div>,
render: () => <RulesOverview />,
renderDetails: () => <RuleDetails />,
},
{
name: 'Decoders',
Expand All @@ -46,6 +49,11 @@ const views: ViewInterface[] = [
export const WazuhSecurityPoliciesApp = () => {
const history = getHistory();
const [currentTab, setCurrentTab] = useState('');
const [isSideNavOpenOnMobile, setIsSideNavOpenOnMobile] = useState(false);

const toggleOpenOnMobile = () => {
setIsSideNavOpenOnMobile(!isSideNavOpenOnMobile);
};

useEffect(() => {
setCurrentTab(history.location.pathname);
Expand Down Expand Up @@ -76,7 +84,13 @@ export const WazuhSecurityPoliciesApp = () => {
<>
<EuiPage paddingSize='m'>
<EuiPageSideBar>
<EuiSideNav aria-label='Ruleset' items={sideNav} />
<EuiSideNav
mobileTitle='Ruleset'
toggleOpenOnMobile={() => toggleOpenOnMobile()}
isOpenOnMobile={isSideNavOpenOnMobile}
aria-label='Ruleset'
items={sideNav}
/>
</EuiPageSideBar>
<EuiPageBody component='main'>
<EuiPanel
Expand Down
Loading

0 comments on commit c78abd9

Please sign in to comment.