import { CircleHelp, Settings2 } from 'lucide-react'; import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Checkbox } from '@/components/ui/checkbox'; import { Field, FieldDescription, FieldGroup, FieldLabel, } from '@/components/ui/field'; import { Input } from '@/components/ui/input'; import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import { Separator } from '@/components/ui/separator'; import { Switch } from '@/components/ui/switch'; import { Textarea } from '@/components/ui/textarea'; import { Tooltip, TooltipContent, TooltipTrigger, } from '@/components/ui/tooltip'; import type { WAFIPGroup, WAFRuleNode } from '@/lib/services/openflare'; import { countryOptions, regionOptions, type GeoOption } from './geo-options'; import { NODE_TYPE_LABELS } from './node-factory'; import { UA_BROWSER_OPTIONS, UA_OS_OPTIONS } from './ua-options'; export function NodeProperties({ node, ipGroups, onChange, }: { node: WAFRuleNode; ipGroups: WAFIPGroup[]; onChange: (node: WAFRuleNode) => void; }) { return ( ); } function PropertyFields({ node, ipGroups, onChange, }: { node: WAFRuleNode; ipGroups: WAFIPGroup[]; onChange: (node: WAFRuleNode) => void; }) { if (node.type === 'start' || node.type === 'allow') return
系统节点无需配置。
; if (node.type === 'ip_match') return (UA 检查
屏蔽
UA 匹配
安全防护
基础防护
{( [ { key: 'path_traversal', label: '路径穿越防护', tip: '检测 Path / Query / Body 中的 ../ 与编码变种', }, { key: 'file_inclusion', label: '文件包含(LFI/RFI)', tip: '检测 Path / Query / Body 中的 php://、file://、/etc/passwd 等', }, { key: 'sql_injection', label: 'SQL 注入', tip: '检测 Query / Body / Header / Cookie 中的 SQL 注入特征', }, { key: 'command_injection', label: '命令注入', tip: '检测 Query / Body / Header 中的 OS 命令注入特征', }, { key: 'xss', label: 'XSS', tip: '检测 Query / Body / Header 中的反射型 XSS 特征', }, { key: 'ssrf', label: 'SSRF', tip: '检测 Query / Body 中的内网地址与危险协议', }, { key: 'malicious_upload', label: '恶意文件上传', tip: '检测 Multipart 文件名与危险扩展名', }, { key: 'xxe', label: 'XXE', tip: '检测 XML Body 中的外部实体特征', }, { key: 'crlf_injection', label: 'CRLF 注入', tip: '检测 Header / Query / Body 中的换行注入', }, ] as const ).map((item) => ({searchRequired && !query ? `输入名称或代码搜索 ${options.length} 个选项` : '没有匹配的选项'}
) : ( visible.map((option) => ( )) )}