'use client'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import type { WAFIPGroupAutoTestResult } from '@/lib/services/openflare'; interface IPGroupTestDialogProps { open: boolean; loading: boolean; result: WAFIPGroupAutoTestResult | null; onOpenChange: (open: boolean) => void; } export function IPGroupTestDialog({ open, loading, result, onOpenChange, }: IPGroupTestDialogProps) { return ( 自动规则测试结果 基于当前自动配置 JSON 对请求日志进行回看测试。 {loading ? (

测试中...

) : result ? (

回看 {result.lookback_minutes} 分钟 · 规则 {result.rule_count}{' '} 条 · 命中 {result.matched_count} 个 IP

测试时间:{new Date(result.tested_at).toLocaleString()}

{result.matched_count > 0 ? (
                {result.matched_ips.join('\n')}
              
) : (

当前没有匹配到任何 IP。

)}
) : (

暂无测试结果。

)}
); }