chore: remove stale dashboard mock counters

This commit is contained in:
Haitao Pan 2026-06-13 07:45:28 +08:00
parent f4a551ef49
commit d460a6e63e
4 changed files with 9 additions and 39 deletions

View File

@ -1,7 +1,7 @@
'use client';
import { useEffect, useMemo, useState } from 'react';
import { customWorkspaceTabs, fallbackMetrics, initialTabs, labelsEn, labelsZh, mockServices } from '@/lib/data';
import { customWorkspaceTabs, fallbackMetrics, initialTabs, labelsEn, labelsZh } from '@/lib/data';
import type { NavItem, RuntimeMetrics, Service, Tab } from '@/lib/data';
import { fetchDashboardStatus } from '@/lib/api';
import { Sidebar } from './Sidebar';
@ -69,7 +69,7 @@ export function AppShell() {
return () => window.removeEventListener('keydown', onKey);
}, []);
const currentServices = services ?? mockServices;
const currentServices = services ?? [];
const selected = tabs.find((tab) => tab.id === selectedTab);
const labels = language === 'zh' ? labelsZh : labelsEn;

View File

@ -1,14 +1,12 @@
'use client';
import { useState } from 'react';
import { agents, findServiceDef, skillGroups } from '@/lib/data';
import type { Labels, Service } from '@/lib/data';
import { findServiceDef } from '@/lib/data';
import type { Labels, RuntimeMetrics, Service } from '@/lib/data';
import { Icon } from './Icon';
export function PanelsRow({ labels, services }: { labels: Labels; services: Service[] }) {
export function PanelsRow({ labels, services, metrics }: { labels: Labels; services: Service[]; metrics: RuntimeMetrics }) {
const [range, setRange] = useState('7d');
const runningAgents = agents.filter((agent) => agent.state === 'Running').length;
const totalSkills = skillGroups.reduce((count, group) => count + group.skills.length, 0);
return (
<div className="panels-row">
@ -39,10 +37,10 @@ export function PanelsRow({ labels, services }: { labels: Labels; services: Serv
<h2>{labels.systemOverview}</h2>
</div>
<div className="overview-grid">
<div><strong>4</strong><small>{labels.activeSessions}</small></div>
<div><strong>{runningAgents}/{agents.length}</strong><small>{labels.connectedAgents}</small></div>
<div><strong>52</strong><small>{labels.activeModels}</small></div>
<div><strong>{totalSkills}+</strong><small>{labels.skillsAvailable}</small></div>
<div><strong>{metrics.activeSessions}</strong><small>{labels.activeSessions}</small></div>
<div><strong>{metrics.connectedAgents}</strong><small>{labels.connectedAgents}</small></div>
<div><strong>{metrics.activeModels}</strong><small>{labels.activeModels}</small></div>
<div><strong>{metrics.skillsAvailable}+</strong><small>{labels.skillsAvailable}</small></div>
</div>
</section>

View File

@ -64,9 +64,6 @@ export function Sidebar({
>
<Icon name={item.icon} />
<span>{item.label}</span>
{item.id === 'sessions' ? <em>333</em> : null}
{item.id === 'skills' ? <em>30+</em> : null}
{item.id === 'models' ? <em>52</em> : null}
</a>
))
: null}

View File

@ -89,14 +89,6 @@ export const initialTabs: Tab[] = [
{ id: 'workspace', label: 'Workspace', href: '#workspace', kind: 'internal', icon: 'home', source: 'builtin' },
];
export const mockServices: Service[] = [
{ name: 'OpenClaw Gateway', state: 'Running' },
{ name: 'Bridge', state: 'Running' },
{ name: 'LiteLLM', state: 'Running' },
{ name: 'Vault', state: 'Running' },
{ name: 'XWorkmate Bridge', state: 'Running' },
];
export const fallbackMetrics: RuntimeMetrics = {
activeSessions: 0,
connectedAgents: 0,
@ -105,22 +97,6 @@ export const fallbackMetrics: RuntimeMetrics = {
workers: 0,
};
export const agents = [
{ name: 'Codex Agent', state: 'Idle', workspace: 'xworkspace-console', task: 'Homepage redesign' },
{ name: 'Hermes Agent', state: 'Running', workspace: 'messaging', task: 'Gateway sync' },
{ name: 'Gemini Agent', state: 'Idle', workspace: 'research', task: 'Waiting for input' },
{ name: 'Claude Agent', state: 'Running', workspace: 'docs', task: 'Design review' },
{ name: 'Qwen Agent', state: 'Idle', workspace: 'runtime', task: 'No active task' },
];
export const tasks = [
['Generate Report', 'Hermes', 'Running'],
['Data Analysis', 'Codex', 'Completed'],
['Create Presentation', 'Gemini', 'Completed'],
['Code Refactor', 'Claude', 'Failed'],
['Document Summary', 'Qwen', 'Completed'],
];
export const skillGroups = [
{ name: 'Content', skills: ['AI News Video', 'Product Video', 'IT Evolution Video'] },
{ name: 'Document', skills: ['PDF', 'DOCX', 'XLSX', 'PPTX'] },
@ -129,7 +105,6 @@ export const skillGroups = [
];
export const acpAgents = ['Claude', 'Gemini', 'Codex', 'Hermes', 'Qwen', 'OpenCode'];
export const modelTargets = 'GPT-5.5 · DeepSeek V4 · Gemini 3.1 · GLM 5 · Kimi · Claude';
export type Labels = Record<string, string>;