From 85090899e624787efdafcd159548a2eac4d6f976 Mon Sep 17 00:00:00 2001 From: sp mac bookpro 2605 Date: Mon, 8 Jun 2026 15:12:13 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E4=BD=93=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/AgentList.tsx | 155 ++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 79 deletions(-) diff --git a/src/pages/AgentList.tsx b/src/pages/AgentList.tsx index 53918c8..d2e33d9 100644 --- a/src/pages/AgentList.tsx +++ b/src/pages/AgentList.tsx @@ -8,39 +8,39 @@ import { RobotOutlined } from '@ant-design/icons'; import { Button, Col, Row, Empty, Popconfirm, App as AntApp, Tag, Space } from 'antd'; -import { Link, useNavigate } from 'react-router-dom'; -import dayjs from 'dayjs'; -import { Agent, AgentAPI } from '../api'; - -export default function AgentList() { - const [list, setList] = useState([]); - const [loading, setLoading] = useState(false); - const navigate = useNavigate(); - const { message } = AntApp.useApp(); - - const load = async () => { - setLoading(true); - try { - setList(await AgentAPI.list()); - } finally { - setLoading(false); - } - }; - useEffect(() => { - load(); - }, []); - - const handleDelete = async (id: string) => { - await AgentAPI.remove(id); - message.success('已删除'); - load(); - }; - - const isImageUrl = (url: string) => url?.startsWith('http') || url?.startsWith('/'); +import { Link, useNavigate } from 'react-router-dom'; +import dayjs from 'dayjs'; +import { Agent, AgentAPI } from '../api'; + +export default function AgentList() { + const [list, setList] = useState([]); + const [loading, setLoading] = useState(false); + const navigate = useNavigate(); + const { message } = AntApp.useApp(); + + const load = async () => { + setLoading(true); + try { + setList(await AgentAPI.list()); + } finally { + setLoading(false); + } + }; + useEffect(() => { + load(); + }, []); + + const handleDelete = async (id: string) => { + await AgentAPI.remove(id); + message.success('已删除'); + load(); + }; + + const isImageUrl = (url: string) => url?.startsWith('http') || url?.startsWith('/'); const publicCount = useMemo(() => list.filter((a) => a.visibility === 'public').length, [list]); const teamCount = useMemo(() => list.filter((a) => a.visibility === 'team').length, [list]); - - return ( + + return (
把你的 AI 助手沉淀成一组可管理、可协作、可持续进化的能力单元。创建入口统一在智能体广场,这里负责查看、进入和运营它们。
-
+ - +
{[ @@ -135,20 +135,20 @@ export default function AgentList() {
))} - - - {!loading && list.length === 0 ? ( -
- +
+ + {!loading && list.length === 0 ? ( +
+ - -
- ) : ( + 前往广场创建 + + + + ) : ( - {list.map((a) => ( - + {list.map((a) => ( +
- {isImageUrl(a.avatar) ? ( - avatar - ) : ( - (a.name?.charAt(0) || '?').toUpperCase() - )} -
-
+ {isImageUrl(a.avatar) ? ( + avatar + ) : ( + (a.name?.charAt(0) || '?').toUpperCase() + )} +
+
{a.name}
最近更新于 {dayjs(a.updated_at).format('YYYY-MM-DD')} -
-
- + + +
)} - - T={a.temperature} - {(a.fork_count ?? 0) > 0 && ( Fork {a.fork_count} )} - +
- - + + - - handleDelete(a.id)} - okText="删除" - cancelText="取消" - > + + handleDelete(a.id)} + okText="删除" + cancelText="取消" + >
-
- - ))} -
- )} + + + + + ))} + + )} {list.length > 0 && (
)} - - ); -} + + ); +}