mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 22:26:38 +08:00
b75f985815
基础特征检测九项可开关;默认开启路径穿越与文件包含;命中任意规则走 false。
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import {
|
|
Ban,
|
|
Fingerprint,
|
|
Globe2,
|
|
ScanSearch,
|
|
Shield,
|
|
ShieldCheck,
|
|
} from 'lucide-react';
|
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
import {
|
|
NODE_TYPE_LABELS,
|
|
WAF_NODE_DRAG_MIME,
|
|
type AddableNodeType,
|
|
} from './node-factory';
|
|
|
|
const items = [
|
|
{ type: 'ip_match' as const, icon: Fingerprint },
|
|
{ type: 'geo_match' as const, icon: Globe2 },
|
|
{ type: 'ua_check' as const, icon: ScanSearch },
|
|
{ type: 'security_check' as const, icon: Shield },
|
|
{ type: 'pow' as const, icon: ShieldCheck },
|
|
{ type: 'block' as const, icon: Ban },
|
|
] satisfies { type: AddableNodeType; icon: typeof Fingerprint }[];
|
|
|
|
export function NodeLibrary() {
|
|
return (
|
|
<div className='flex items-center gap-2'>
|
|
{items.map(({ type, icon: Icon }) => (
|
|
<Button
|
|
key={type}
|
|
type='button'
|
|
variant='outline'
|
|
size='sm'
|
|
draggable
|
|
className='cursor-grab active:cursor-grabbing'
|
|
onDragStart={(event) => {
|
|
event.dataTransfer.setData(WAF_NODE_DRAG_MIME, type);
|
|
event.dataTransfer.setData('text/plain', type);
|
|
event.dataTransfer.effectAllowed = 'copy';
|
|
}}
|
|
>
|
|
<Icon data-icon='inline-start' />
|
|
{NODE_TYPE_LABELS[type]}
|
|
</Button>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|