The old /deployments (运行总览) + /tasks/$id pages rendered the new template agents with meaningless old sub-task fields (待确认/sub_agile/子任务流/智能体任务图/产物/ SK快照/合并时间线 — all empty). Removed the whole old-model UI cluster and pointed the Overview dashboard at the real new endpoint: - deleted features/agent-console, features/agent-hub, features/tasks and the routes /deployments and /tasks/$id. - cockpit (Overview) now lists deployed template agents from /api/heicode/agents (status counts + recent agents), not the old listAgentDeployments. - removed the "运行总览" sidebar item + dead /deployments links in footer / top-nav / sidebar-config. - routeTree regenerated; frontend build + tsc clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
118 lines
3.1 KiB
TypeScript
Vendored
118 lines
3.1 KiB
TypeScript
Vendored
import {
|
|
Bot,
|
|
Command,
|
|
Download,
|
|
GitBranch,
|
|
LayoutDashboard,
|
|
Settings,
|
|
Smartphone,
|
|
UserCog,
|
|
Wallet,
|
|
} from 'lucide-react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { WORKSPACE_IDS } from '@/components/layout/lib/workspace-registry'
|
|
import { type SidebarData } from '@/components/layout/types'
|
|
|
|
/**
|
|
* Heicode Manager 默认 workspace 侧边栏。
|
|
*
|
|
* 文案与结构以 docs/product-package/10-frontend-detail-spec.md §"全局体验结构" 和
|
|
* docs/product-package/11-product-prototype-wireframes.md §4 Manager 原型为准。
|
|
*
|
|
* - 不使用"Git 来源 / Deployments / Events"等后台术语,统一替换为"准备清单 / 任务总览 / 审计"等用户语义。
|
|
* - 钱包 + 可用模型 合并为"模型与余额"。
|
|
* - 我的资料 改名"账号安全"。
|
|
* - admin/root 管理类入口(Channels/Models/Tenants/...)仍统一归到"系统设置" workspace。
|
|
*/
|
|
export function useSidebarData(): SidebarData {
|
|
const { t } = useTranslation()
|
|
|
|
return {
|
|
workspaces: [
|
|
{
|
|
id: WORKSPACE_IDS.DEFAULT,
|
|
name: '',
|
|
logo: Command,
|
|
plan: '',
|
|
},
|
|
],
|
|
navGroups: [
|
|
// ============ Heicode 主流程(按 docs §10 全局体验结构)============
|
|
{
|
|
id: 'cockpit',
|
|
title: t('Heicode'),
|
|
items: [
|
|
{
|
|
title: t('Overview'),
|
|
url: '/dashboard',
|
|
icon: LayoutDashboard,
|
|
},
|
|
{
|
|
title: t('Resource binding'),
|
|
url: '/resources',
|
|
icon: GitBranch,
|
|
},
|
|
{
|
|
title: t('Deploy sub agent'),
|
|
url: '/deploy-agent',
|
|
icon: Bot,
|
|
},
|
|
],
|
|
},
|
|
|
|
// ============ 辅助入口 ============
|
|
{
|
|
id: 'personal',
|
|
title: t('Personal'),
|
|
items: [
|
|
{
|
|
title: t('Models and balance'),
|
|
url: '/wallet',
|
|
icon: Wallet,
|
|
},
|
|
{
|
|
title: t('Heicode desktop client'),
|
|
url: '/desktop-client',
|
|
icon: Download,
|
|
},
|
|
{
|
|
title: t('Devices'),
|
|
url: '/devices',
|
|
icon: Smartphone,
|
|
},
|
|
{
|
|
title: t('Account security'),
|
|
url: '/profile',
|
|
icon: UserCog,
|
|
},
|
|
],
|
|
},
|
|
|
|
// ============ Admin entry (仅 ROLE.ADMIN+ 可见) ============
|
|
// 单一入口:跳转到管理 workspace。admin 进入 /channels(管理首页),
|
|
// root 进入 /system-settings/general。两种角色进入后侧边栏均切换为
|
|
// system-settings workspace(由 workspace-registry 路径匹配触发)。
|
|
{
|
|
id: 'admin-entry',
|
|
title: t('Administration'),
|
|
items: [
|
|
{
|
|
title: t('System settings'),
|
|
url: '/channels',
|
|
activeUrls: [
|
|
'/system-settings',
|
|
'/channels',
|
|
'/users',
|
|
'/redemption-codes',
|
|
'/subscriptions',
|
|
'/models',
|
|
'/usage-logs',
|
|
],
|
|
icon: Settings,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|
|
}
|