feat: remove agent audit page and set dashboard as root path
Build and Push CodeReview / build (push) Waiting to run
Details
Build and Push CodeReview / build (push) Waiting to run
Details
This commit is contained in:
parent
0e2a7dfa87
commit
e537010dfd
|
|
@ -24,9 +24,9 @@ export interface RouteConfig {
|
|||
const routes: RouteConfig[] = [
|
||||
{
|
||||
name: "Agent审计",
|
||||
path: "/",
|
||||
path: "/agent-audit",
|
||||
element: <AgentAudit />,
|
||||
visible: true,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
name: "Agent审计任务",
|
||||
|
|
@ -36,7 +36,7 @@ const routes: RouteConfig[] = [
|
|||
},
|
||||
{
|
||||
name: "仪表盘",
|
||||
path: "/dashboard",
|
||||
path: "/",
|
||||
element: <Dashboard />,
|
||||
visible: true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -669,8 +669,8 @@ function ProjectCard({
|
|||
return (
|
||||
<div
|
||||
className={`flex items-center gap-3 p-3 cursor-pointer rounded transition-all ${selected
|
||||
? "bg-primary/10 border border-primary/50"
|
||||
: "hover:bg-muted border border-transparent"
|
||||
? "bg-primary/10 border border-primary/50"
|
||||
: "hover:bg-muted border border-transparent"
|
||||
}`}
|
||||
onClick={onSelect}
|
||||
>
|
||||
|
|
@ -694,8 +694,8 @@ function ProjectCard({
|
|||
</span>
|
||||
<Badge
|
||||
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-amber-500/20 text-amber-600 dark:text-amber-400 border-amber-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"
|
||||
}`}
|
||||
>
|
||||
{isRepo ? "REPO" : "ZIP"}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ import routes from "@/app/routes";
|
|||
|
||||
// Icon mapping for routes with consistent sizing
|
||||
const routeIcons: Record<string, React.ReactNode> = {
|
||||
"/": <Bot className="w-5 h-5" />,
|
||||
"/dashboard": <LayoutDashboard className="w-5 h-5" />,
|
||||
"/": <LayoutDashboard className="w-5 h-5" />,
|
||||
"/agent-audit": <Bot className="w-5 h-5" />,
|
||||
"/projects": <FolderGit2 className="w-5 h-5" />,
|
||||
"/instant-analysis": <Zap className="w-5 h-5" />,
|
||||
"/audit-tasks": <ListTodo className="w-5 h-5" />,
|
||||
|
|
|
|||
|
|
@ -980,7 +980,7 @@ function AgentAuditPageContent() {
|
|||
{isRunning ? (
|
||||
<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" />
|
||||
<span className="font-mono text-center">INITIALIZING<br/>AGENTS...</span>
|
||||
<span className="font-mono text-center">INITIALIZING<br />AGENTS...</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col items-center gap-2 p-6 text-center">
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ export default function AuditTasks() {
|
|||
</Button>
|
||||
)}
|
||||
{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" />
|
||||
新建Agent审计
|
||||
</Button>
|
||||
|
|
@ -790,7 +790,7 @@ export default function AuditTasks() {
|
|||
{searchTerm || statusFilter !== "all" ? '尝试调整搜索条件或筛选器' : '创建第一个Agent审计任务开始智能安全审计'}
|
||||
</p>
|
||||
{!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" />
|
||||
创建Agent审计
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -442,14 +442,13 @@ export default function Dashboard() {
|
|||
}}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<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 === 'running' ? 'bg-sky-500/20 text-sky-400' :
|
||||
'bg-rose-500/20 text-rose-400'
|
||||
}`}>
|
||||
<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 === 'running' ? 'bg-sky-500/20 text-sky-400' :
|
||||
'bg-rose-500/20 text-rose-400'
|
||||
}`}>
|
||||
{task.status === 'completed' ? <Activity className="w-4 h-4" /> :
|
||||
task.status === 'running' ? <Clock className="w-4 h-4" /> :
|
||||
<AlertTriangle className="w-4 h-4" />}
|
||||
task.status === 'running' ? <Clock className="w-4 h-4" /> :
|
||||
<AlertTriangle className="w-4 h-4" />}
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-base font-medium text-foreground group-hover:text-primary transition-colors">
|
||||
|
|
@ -521,8 +520,8 @@ export default function Dashboard() {
|
|||
<Badge className={`
|
||||
${dbMode === 'api' ? 'cyber-badge-primary' :
|
||||
dbMode === 'local' ? 'cyber-badge-info' :
|
||||
dbMode === 'supabase' ? 'cyber-badge-success' :
|
||||
'cyber-badge-muted'}
|
||||
dbMode === 'supabase' ? 'cyber-badge-success' :
|
||||
'cyber-badge-muted'}
|
||||
`}>
|
||||
{dbMode === 'api' ? '后端' : dbMode === 'local' ? '本地' : dbMode === 'supabase' ? '云端' : '演示'}
|
||||
</Badge>
|
||||
|
|
@ -588,19 +587,18 @@ export default function Dashboard() {
|
|||
|
||||
const statusText =
|
||||
task.status === 'completed' ? '任务完成' :
|
||||
task.status === 'running' ? '任务运行中' :
|
||||
task.status === 'failed' ? '任务失败' : '任务待处理';
|
||||
task.status === 'running' ? '任务运行中' :
|
||||
task.status === 'failed' ? '任务失败' : '任务待处理';
|
||||
|
||||
return (
|
||||
<Link
|
||||
key={task.id}
|
||||
to={`/tasks/${task.id}`}
|
||||
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 === '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' :
|
||||
'bg-muted/30 border-border hover:border-border'
|
||||
}`}
|
||||
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 === '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' :
|
||||
'bg-muted/30 border-border hover:border-border'
|
||||
}`}
|
||||
>
|
||||
<p className="text-base font-medium text-foreground">{statusText}</p>
|
||||
<p className="text-sm text-muted-foreground mt-1 line-clamp-1">
|
||||
|
|
|
|||
Loading…
Reference in New Issue