mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-14 02:46:37 +08:00
prettier
This commit is contained in:
@@ -8,8 +8,8 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import {Button} from '@/components/ui/button';
|
||||
import type {WAFIPGroupAutoTestResult} from '@/lib/services/openflare';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import type { WAFIPGroupAutoTestResult } from '@/lib/services/openflare';
|
||||
|
||||
interface IPGroupTestDialogProps {
|
||||
open: boolean;
|
||||
@@ -26,7 +26,7 @@ export function IPGroupTestDialog({
|
||||
}: IPGroupTestDialogProps) {
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-2xl">
|
||||
<DialogContent className='max-w-2xl'>
|
||||
<DialogHeader>
|
||||
<DialogTitle>自动规则测试结果</DialogTitle>
|
||||
<DialogDescription>
|
||||
@@ -35,32 +35,38 @@ export function IPGroupTestDialog({
|
||||
</DialogHeader>
|
||||
|
||||
{loading ? (
|
||||
<p className="text-sm text-muted-foreground py-6 text-center">测试中...</p>
|
||||
<p className='text-sm text-muted-foreground py-6 text-center'>
|
||||
测试中...
|
||||
</p>
|
||||
) : result ? (
|
||||
<div className="space-y-4">
|
||||
<div className="rounded-lg border border-dashed p-4 text-sm">
|
||||
<div className='space-y-4'>
|
||||
<div className='rounded-lg border border-dashed p-4 text-sm'>
|
||||
<p>
|
||||
回看 {result.lookback_minutes} 分钟 · 规则 {result.rule_count} 条 · 命中{' '}
|
||||
{result.matched_count} 个 IP
|
||||
回看 {result.lookback_minutes} 分钟 · 规则 {result.rule_count}{' '}
|
||||
条 · 命中 {result.matched_count} 个 IP
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">
|
||||
<p className='text-xs text-muted-foreground mt-1'>
|
||||
测试时间:{new Date(result.tested_at).toLocaleString()}
|
||||
</p>
|
||||
</div>
|
||||
{result.matched_count > 0 ? (
|
||||
<pre className="max-h-64 overflow-auto rounded-lg border bg-muted/40 p-3 text-xs whitespace-pre-wrap break-all">
|
||||
<pre className='max-h-64 overflow-auto rounded-lg border bg-muted/40 p-3 text-xs whitespace-pre-wrap break-all'>
|
||||
{result.matched_ips.join('\n')}
|
||||
</pre>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">当前没有匹配到任何 IP。</p>
|
||||
<p className='text-sm text-muted-foreground'>
|
||||
当前没有匹配到任何 IP。
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground py-6 text-center">暂无测试结果。</p>
|
||||
<p className='text-sm text-muted-foreground py-6 text-center'>
|
||||
暂无测试结果。
|
||||
</p>
|
||||
)}
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="button" onClick={() => onOpenChange(false)}>
|
||||
<Button type='button' onClick={() => onOpenChange(false)}>
|
||||
关闭
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
Reference in New Issue
Block a user