feat: remove agent audit page and set dashboard as root path
Build and Push CodeReview / build (push) Waiting to run Details

This commit is contained in:
vinland100 2026-01-08 15:11:37 +08:00
parent 0e2a7dfa87
commit e537010dfd
6 changed files with 27 additions and 29 deletions

View File

@ -24,9 +24,9 @@ export interface RouteConfig {
const routes: RouteConfig[] = [ const routes: RouteConfig[] = [
{ {
name: "Agent审计", name: "Agent审计",
path: "/", path: "/agent-audit",
element: <AgentAudit />, element: <AgentAudit />,
visible: true, visible: false,
}, },
{ {
name: "Agent审计任务", name: "Agent审计任务",
@ -36,7 +36,7 @@ const routes: RouteConfig[] = [
}, },
{ {
name: "仪表盘", name: "仪表盘",
path: "/dashboard", path: "/",
element: <Dashboard />, element: <Dashboard />,
visible: true, visible: true,
}, },

View File

@ -669,8 +669,8 @@ function ProjectCard({
return ( return (
<div <div
className={`flex items-center gap-3 p-3 cursor-pointer rounded transition-all ${selected className={`flex items-center gap-3 p-3 cursor-pointer rounded transition-all ${selected
? "bg-primary/10 border border-primary/50" ? "bg-primary/10 border border-primary/50"
: "hover:bg-muted border border-transparent" : "hover:bg-muted border border-transparent"
}`} }`}
onClick={onSelect} onClick={onSelect}
> >
@ -694,8 +694,8 @@ function ProjectCard({
</span> </span>
<Badge <Badge
className={`text-xs px-1 py-0 font-mono ${isRepo className={`text-xs px-1 py-0 font-mono ${isRepo
? "bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/30" ? "bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/30"
: "bg-amber-500/20 text-amber-600 dark:text-amber-400 border-amber-500/30" : "bg-amber-500/20 text-amber-600 dark:text-amber-400 border-amber-500/30"
}`} }`}
> >
{isRepo ? "REPO" : "ZIP"} {isRepo ? "REPO" : "ZIP"}

View File

@ -29,8 +29,8 @@ import routes from "@/app/routes";
// Icon mapping for routes with consistent sizing // Icon mapping for routes with consistent sizing
const routeIcons: Record<string, React.ReactNode> = { const routeIcons: Record<string, React.ReactNode> = {
"/": <Bot className="w-5 h-5" />, "/": <LayoutDashboard className="w-5 h-5" />,
"/dashboard": <LayoutDashboard className="w-5 h-5" />, "/agent-audit": <Bot className="w-5 h-5" />,
"/projects": <FolderGit2 className="w-5 h-5" />, "/projects": <FolderGit2 className="w-5 h-5" />,
"/instant-analysis": <Zap className="w-5 h-5" />, "/instant-analysis": <Zap className="w-5 h-5" />,
"/audit-tasks": <ListTodo className="w-5 h-5" />, "/audit-tasks": <ListTodo className="w-5 h-5" />,

View File

@ -980,7 +980,7 @@ function AgentAuditPageContent() {
{isRunning ? ( {isRunning ? (
<div className="flex flex-col items-center gap-3 p-6"> <div className="flex flex-col items-center gap-3 p-6">
<Loader2 className="w-6 h-6 animate-spin text-violet-600 dark:text-violet-500" /> <Loader2 className="w-6 h-6 animate-spin text-violet-600 dark:text-violet-500" />
<span className="font-mono text-center">INITIALIZING<br/>AGENTS...</span> <span className="font-mono text-center">INITIALIZING<br />AGENTS...</span>
</div> </div>
) : ( ) : (
<div className="flex flex-col items-center gap-2 p-6 text-center"> <div className="flex flex-col items-center gap-2 p-6 text-center">

View File

@ -574,7 +574,7 @@ export default function AuditTasks() {
</Button> </Button>
)} )}
{activeTab === "agent" && ( {activeTab === "agent" && (
<Button className="cyber-btn-primary h-10" onClick={() => navigate("/")}> <Button className="cyber-btn-primary h-10" onClick={() => navigate("/agent-audit")}>
<Bot className="w-4 h-4 mr-2" /> <Bot className="w-4 h-4 mr-2" />
Agent审计 Agent审计
</Button> </Button>
@ -790,7 +790,7 @@ export default function AuditTasks() {
{searchTerm || statusFilter !== "all" ? '尝试调整搜索条件或筛选器' : '创建第一个Agent审计任务开始智能安全审计'} {searchTerm || statusFilter !== "all" ? '尝试调整搜索条件或筛选器' : '创建第一个Agent审计任务开始智能安全审计'}
</p> </p>
{!searchTerm && statusFilter === "all" && ( {!searchTerm && statusFilter === "all" && (
<Button className="cyber-btn-primary" onClick={() => navigate("/")}> <Button className="cyber-btn-primary" onClick={() => navigate("/agent-audit")}>
<Bot className="w-4 h-4 mr-2" /> <Bot className="w-4 h-4 mr-2" />
Agent审计 Agent审计
</Button> </Button>

View File

@ -442,14 +442,13 @@ export default function Dashboard() {
}} }}
> >
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<div className={`w-8 h-8 rounded-lg flex items-center justify-center ${ <div className={`w-8 h-8 rounded-lg flex items-center justify-center ${task.status === 'completed' ? 'bg-emerald-500/20 text-emerald-400' :
task.status === 'completed' ? 'bg-emerald-500/20 text-emerald-400' : task.status === 'running' ? 'bg-sky-500/20 text-sky-400' :
task.status === 'running' ? 'bg-sky-500/20 text-sky-400' : 'bg-rose-500/20 text-rose-400'
'bg-rose-500/20 text-rose-400' }`}>
}`}>
{task.status === 'completed' ? <Activity className="w-4 h-4" /> : {task.status === 'completed' ? <Activity className="w-4 h-4" /> :
task.status === 'running' ? <Clock className="w-4 h-4" /> : task.status === 'running' ? <Clock className="w-4 h-4" /> :
<AlertTriangle className="w-4 h-4" />} <AlertTriangle className="w-4 h-4" />}
</div> </div>
<div> <div>
<p className="text-base font-medium text-foreground group-hover:text-primary transition-colors"> <p className="text-base font-medium text-foreground group-hover:text-primary transition-colors">
@ -521,8 +520,8 @@ export default function Dashboard() {
<Badge className={` <Badge className={`
${dbMode === 'api' ? 'cyber-badge-primary' : ${dbMode === 'api' ? 'cyber-badge-primary' :
dbMode === 'local' ? 'cyber-badge-info' : dbMode === 'local' ? 'cyber-badge-info' :
dbMode === 'supabase' ? 'cyber-badge-success' : dbMode === 'supabase' ? 'cyber-badge-success' :
'cyber-badge-muted'} 'cyber-badge-muted'}
`}> `}>
{dbMode === 'api' ? '后端' : dbMode === 'local' ? '本地' : dbMode === 'supabase' ? '云端' : '演示'} {dbMode === 'api' ? '后端' : dbMode === 'local' ? '本地' : dbMode === 'supabase' ? '云端' : '演示'}
</Badge> </Badge>
@ -588,19 +587,18 @@ export default function Dashboard() {
const statusText = const statusText =
task.status === 'completed' ? '任务完成' : task.status === 'completed' ? '任务完成' :
task.status === 'running' ? '任务运行中' : task.status === 'running' ? '任务运行中' :
task.status === 'failed' ? '任务失败' : '任务待处理'; task.status === 'failed' ? '任务失败' : '任务待处理';
return ( return (
<Link <Link
key={task.id} key={task.id}
to={`/tasks/${task.id}`} to={`/tasks/${task.id}`}
className={`block p-3 rounded-lg border transition-all ${ className={`block p-3 rounded-lg border transition-all ${task.status === 'completed' ? 'bg-emerald-500/5 border-emerald-500/20 hover:border-emerald-500/40' :
task.status === 'completed' ? 'bg-emerald-500/5 border-emerald-500/20 hover:border-emerald-500/40' : task.status === 'running' ? 'bg-sky-500/5 border-sky-500/20 hover:border-sky-500/40' :
task.status === 'running' ? 'bg-sky-500/5 border-sky-500/20 hover:border-sky-500/40' : task.status === 'failed' ? 'bg-rose-500/5 border-rose-500/20 hover:border-rose-500/40' :
task.status === 'failed' ? 'bg-rose-500/5 border-rose-500/20 hover:border-rose-500/40' : 'bg-muted/30 border-border hover:border-border'
'bg-muted/30 border-border hover:border-border' }`}
}`}
> >
<p className="text-base font-medium text-foreground">{statusText}</p> <p className="text-base font-medium text-foreground">{statusText}</p>
<p className="text-sm text-muted-foreground mt-1 line-clamp-1"> <p className="text-sm text-muted-foreground mt-1 line-clamp-1">