🔧 修复:过滤掉端口为 0 的内部进程

变更:
- 前端 Dashboard 只显示端口>0 的有效龙虾
- 隐藏 openclaw-process-* 等临时进程
- 隐藏 openclaw-gateway 网关节点

现在只显示 8 只正常服务的龙虾
This commit is contained in:
2026-04-04 19:18:10 +08:00
parent 13a40495e4
commit 4dbbbeaf6a
2 changed files with 3 additions and 1 deletions

BIN
code/backend/db.sqlite3 Normal file

Binary file not shown.

View File

@@ -21,7 +21,9 @@ function Dashboard() {
const fetchAgents = async () => { const fetchAgents = async () => {
try { try {
const response = await axios.get(`${API_BASE}/agents/`); const response = await axios.get(`${API_BASE}/agents/`);
setAgents(response.data); // 过滤掉端口为 0 的内部进程
const validAgents = response.data.filter(agent => agent.port && agent.port > 0);
setAgents(validAgents);
setLoading(false); setLoading(false);
} catch (error) { } catch (error) {
console.error('获取 Agent 状态失败:', error); console.error('获取 Agent 状态失败:', error);