Files
xingrin/frontend/app/tools/page.tsx
2025-12-12 18:04:57 +08:00

126 lines
4.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { PackageOpen, Settings, ArrowRight } from "lucide-react"
import Link from "next/link"
/**
* 工具概览页面
* 显示开源工具和自定义工具的入口
*/
export default function ToolsPage() {
// 功能模块
const modules = [
{
title: "字典管理",
description: "管理目录扫描等使用的字典文件",
href: "/tools/wordlists/",
icon: PackageOpen,
status: "available",
stats: {
total: "-",
active: "-",
},
},
{
title: "Nuclei 模板",
description: "浏览本地 Nuclei 模板结构及内容",
href: "/tools/nuclei/",
icon: Settings,
status: "available",
stats: {
total: "-",
active: "-",
},
},
]
return (
<div className="flex flex-col gap-4 py-4 md:gap-6 md:py-6">
{/* 页面头部 */}
<div className="flex items-center justify-between px-4 lg:px-6">
<div>
<h2 className="text-2xl font-bold tracking-tight"></h2>
<p className="text-muted-foreground">
</p>
</div>
</div>
{/* 统计卡片 */}
<div className="px-4 lg:px-6">
<div className="grid gap-4 md:grid-cols-2">
{modules.map((module) => (
<Card key={module.title} className="relative hover:shadow-lg transition-shadow">
<CardHeader>
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<module.icon className="h-5 w-5" />
<CardTitle className="text-lg">{module.title}</CardTitle>
</div>
{module.status === "coming-soon" && (
<span className="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full">
线
</span>
)}
</div>
<CardDescription>{module.description}</CardDescription>
</CardHeader>
<CardContent>
<div className="space-y-4">
{/* 统计信息 */}
<div className="flex items-center gap-6 text-sm">
<div>
<span className="text-muted-foreground"></span>
<span className="font-semibold ml-1">{module.stats.total}</span>
</div>
<div>
<span className="text-muted-foreground"></span>
<span className="font-semibold ml-1 text-green-600">{module.stats.active}</span>
</div>
</div>
{/* 操作按钮 */}
{module.status === "available" ? (
<Link href={module.href}>
<Button className="w-full">
<ArrowRight className="h-4 w-4" />
</Button>
</Link>
) : (
<Button disabled className="w-full">
</Button>
)}
</div>
</CardContent>
</Card>
))}
</div>
</div>
{/* 快速操作 */}
<div className="px-4 lg:px-6">
<Card>
<CardHeader>
<CardTitle></CardTitle>
<CardDescription>
</CardDescription>
</CardHeader>
<CardContent>
<div className="flex flex-wrap gap-2">
<Link href="/tools/wordlists/">
<Button variant="outline" size="sm">
<PackageOpen className="h-4 w-4" />
</Button>
</Link>
</div>
</CardContent>
</Card>
</div>
</div>
)
}