add: created components for rules visualization
This commit is contained in:
23
frontend/src/components/Firewall/ActionTypeSelector.tsx
Normal file
23
frontend/src/components/Firewall/ActionTypeSelector.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { SegmentedControl, SegmentedControlProps } from "@mantine/core";
|
||||
import { ActionType } from "./utils";
|
||||
|
||||
|
||||
export const ActionTypeSelector = (props:Omit<SegmentedControlProps, "data">) => (
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{
|
||||
value: ActionType.ACCEPT,
|
||||
label: 'Accept',
|
||||
},
|
||||
{
|
||||
value: ActionType.REJECT,
|
||||
label: 'Reject',
|
||||
},
|
||||
{
|
||||
value: ActionType.DROP,
|
||||
label: 'Drop',
|
||||
}
|
||||
]}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
20
frontend/src/components/Firewall/ModeSelector.tsx
Normal file
20
frontend/src/components/Firewall/ModeSelector.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { SegmentedControl, SegmentedControlProps } from "@mantine/core";
|
||||
import { RuleMode } from "./utils";
|
||||
|
||||
|
||||
|
||||
export const ModeSelector = (props:Omit<SegmentedControlProps, "data">) => (
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{
|
||||
value: RuleMode.IN,
|
||||
label: 'IN',
|
||||
},
|
||||
{
|
||||
value: RuleMode.OUT,
|
||||
label: 'OUT',
|
||||
}
|
||||
]}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
23
frontend/src/components/Firewall/ProtocolSelector.tsx
Normal file
23
frontend/src/components/Firewall/ProtocolSelector.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { SegmentedControl, SegmentedControlProps } from "@mantine/core";
|
||||
import { Protocol } from "./utils";
|
||||
|
||||
|
||||
export const ProtocolSelector = (props:Omit<SegmentedControlProps, "data">) => (
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{
|
||||
value: Protocol.TCP,
|
||||
label: 'TCP',
|
||||
},
|
||||
{
|
||||
value: Protocol.UDP,
|
||||
label: 'UDP',
|
||||
},
|
||||
{
|
||||
value: Protocol.ANY,
|
||||
label: 'ANY',
|
||||
}
|
||||
]}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
Reference in New Issue
Block a user