feat: add Terminal Dashboard components and state management

- Implement TerminalTabBar for session tab management with status indicators and alert badges.
- Create TerminalWorkbench to combine TerminalTabBar and TerminalInstance for terminal session display.
- Add localization support for terminal dashboard in English and Chinese.
- Develop TerminalDashboardPage for the main layout of the terminal dashboard with a three-column structure.
- Introduce Zustand stores for session management and issue/queue integration, handling session groups, terminal metadata, and alert management.
- Create a monitor web worker for off-main-thread output analysis, detecting errors and stalls in terminal sessions.
- Define TypeScript types for terminal dashboard state management and integration.
This commit is contained in:
catlog22
2026-02-14 20:54:05 +08:00
parent 4d22ae4b2f
commit e4b898f401
37 changed files with 2810 additions and 5438 deletions

View File

@@ -39,6 +39,7 @@ import workspace from './workspace.json';
import help from './help.json';
import cliViewer from './cli-viewer.json';
import team from './team.json';
import terminalDashboard from './terminal-dashboard.json';
/**
* Flattens nested JSON object to dot-separated keys
@@ -101,4 +102,5 @@ export default {
...flattenMessages(help, 'help'),
...flattenMessages(cliViewer, 'cliViewer'),
...flattenMessages(team, 'team'),
...flattenMessages(terminalDashboard, 'terminalDashboard'),
} as Record<string, string>;

View File

@@ -35,7 +35,8 @@
"rules": "Rules",
"explorer": "File Explorer",
"graph": "Graph Explorer",
"teams": "Team Execution"
"teams": "Team Execution",
"terminalDashboard": "Terminal Dashboard"
},
"sidebar": {
"collapse": "Collapse",

View File

@@ -0,0 +1,81 @@
{
"page": {
"title": "Terminal Dashboard"
},
"columns": {
"sessions": "Sessions",
"workflow": "Workflow",
"terminal": "Terminal Workbench"
},
"kpi": {
"title": "Dashboard KPI",
"activeSessions": "Active Sessions",
"queueSize": "Queue Size",
"alertCount": "Alerts",
"errorCount": "Errors",
"idleCount": "Idle"
},
"inspector": {
"title": "Inspector",
"noSelection": "Select an item to view details",
"associationChain": "Association Chain"
},
"sessionTree": {
"createGroup": "New Group",
"groupNamePrompt": "Enter group name",
"defaultGroupName": "Untitled Group",
"emptyGroup": "No sessions in this group",
"noGroups": "No session groups yet",
"sessionCount": "{count} sessions",
"dragHint": "Drag sessions between groups"
},
"agentList": {
"title": "Agents",
"noAgents": "No active agents",
"stepLabel": "Step {current}/{total}",
"statusRunning": "Running",
"statusCompleted": "Completed",
"statusFailed": "Failed",
"statusPaused": "Paused",
"statusPending": "Pending"
},
"issuePanel": {
"title": "Issues",
"sendToQueue": "Send to Queue",
"noIssues": "No issues found",
"noIssuesDesc": "Issues will appear here when discovered",
"error": "Failed to load issues"
},
"queuePanel": {
"title": "Queue",
"noItems": "Queue is empty",
"noItemsDesc": "Send issues to queue to start workflow",
"error": "Failed to load queue",
"order": "#{order}",
"dependsOn": "Depends on: {deps}",
"status": {
"pending": "Pending",
"ready": "Ready",
"executing": "Executing",
"completed": "Completed",
"failed": "Failed",
"blocked": "Blocked"
}
},
"tabBar": {
"noTabs": "No terminal sessions"
},
"workbench": {
"noTerminal": "No terminal selected",
"noTerminalHint": "Select a session from the tab bar or create a new one"
},
"placeholder": {
"sessionTree": "Session groups will appear here",
"agentList": "Agent list will appear here",
"issuePanel": "Issue panel will appear here",
"queuePanel": "Queue panel will appear here",
"terminalWorkbench": "Terminal workbench will appear here",
"kpiBar": "KPI metrics will appear here",
"inspector": "Inspector details will appear here"
}
}

View File

@@ -39,6 +39,7 @@ import workspace from './workspace.json';
import help from './help.json';
import cliViewer from './cli-viewer.json';
import team from './team.json';
import terminalDashboard from './terminal-dashboard.json';
/**
* Flattens nested JSON object to dot-separated keys
@@ -101,4 +102,5 @@ export default {
...flattenMessages(help, 'help'),
...flattenMessages(cliViewer, 'cliViewer'),
...flattenMessages(team, 'team'),
...flattenMessages(terminalDashboard, 'terminalDashboard'),
} as Record<string, string>;

View File

@@ -35,7 +35,8 @@
"rules": "规则",
"explorer": "文件浏览器",
"graph": "图浏览器",
"teams": "团队执行"
"teams": "团队执行",
"terminalDashboard": "终端仪表板"
},
"sidebar": {
"collapse": "收起",

View File

@@ -0,0 +1,81 @@
{
"page": {
"title": "终端仪表板"
},
"columns": {
"sessions": "会话",
"workflow": "工作流",
"terminal": "终端工作台"
},
"kpi": {
"title": "仪表板 KPI",
"activeSessions": "活跃会话",
"queueSize": "队列大小",
"alertCount": "告警数",
"errorCount": "错误数",
"idleCount": "空闲数"
},
"inspector": {
"title": "检查器",
"noSelection": "选择一个项目以查看详情",
"associationChain": "关联链路"
},
"sessionTree": {
"createGroup": "新建分组",
"groupNamePrompt": "输入分组名称",
"defaultGroupName": "未命名分组",
"emptyGroup": "此分组暂无会话",
"noGroups": "暂无会话分组",
"sessionCount": "{count} 个会话",
"dragHint": "拖拽会话至其他分组"
},
"agentList": {
"title": "代理",
"noAgents": "暂无活跃代理",
"stepLabel": "步骤 {current}/{total}",
"statusRunning": "运行中",
"statusCompleted": "已完成",
"statusFailed": "已失败",
"statusPaused": "已暂停",
"statusPending": "等待中"
},
"issuePanel": {
"title": "问题",
"sendToQueue": "发送到队列",
"noIssues": "暂无问题",
"noIssuesDesc": "发现问题时将在此显示",
"error": "加载问题失败"
},
"queuePanel": {
"title": "队列",
"noItems": "队列为空",
"noItemsDesc": "将问题发送到队列以启动工作流",
"error": "加载队列失败",
"order": "#{order}",
"dependsOn": "依赖: {deps}",
"status": {
"pending": "等待中",
"ready": "就绪",
"executing": "执行中",
"completed": "已完成",
"failed": "已失败",
"blocked": "已阻塞"
}
},
"tabBar": {
"noTabs": "暂无终端会话"
},
"workbench": {
"noTerminal": "未选择终端",
"noTerminalHint": "从标签栏选择会话或创建新会话"
},
"placeholder": {
"sessionTree": "会话分组将在此显示",
"agentList": "Agent 列表将在此显示",
"issuePanel": "问题面板将在此显示",
"queuePanel": "队列面板将在此显示",
"terminalWorkbench": "终端工作台将在此显示",
"kpiBar": "KPI 指标将在此显示",
"inspector": "检查器详情将在此显示"
}
}