import { useConsole } from "../context"; import { ModuleIcon, type View } from "../components/IconRail"; import { shortId } from "../api/client"; import TaskDetailPanel from "./TaskDetailPanel"; import MembersPanel from "./MembersPanel"; import EnvContextPanel from "./EnvContextPanel"; import SkillsToolsPanel from "./SkillsToolsPanel"; import HealthPanel from "./HealthPanel"; import AutomationsSection from "./AutomationsSection"; import TriageSection from "./TriageSection"; // Right panel, modelled on the Muse screenshot: profile header with a // real connection status (API key / health, never a fake user), an icon // row that switches modules, a 今天 list of recent tasks, and below it // the selected task's detail (or the current module's context) as a // collapsible section. Nothing that was in the old right column is // dropped: the detail/context panels are the same components, only // rendered inside
under the today list. export default function RightPanel({ view, onSelect, onClose }: { view: View; onSelect: (v: View) => void; onClose: () => void; }) { const ctx = useConsole(); const connected = ctx.keySaved; const today = ctx.tasks.slice().reverse().slice(0, 10); const context = (() => { switch (view) { case "projects": return ; case "env": return ; case "skills": return ; case "workers": case "admin": case "key": return ; case "automations": return ; case "triage": return ; default: return ; } })(); const iconRow: Array<[View, string]> = [["task", "任务"], ["admin", "管理区"], ["automations", "自动化"], ["key", "API Key"]]; return (
Codex 命令台
{connected ? "● 已连接" : "○ 未连接(先在 API Key 里保存 key)"}
{ctx.healthText}
{ctx.quotaText}
自动刷新 · 每 10 秒 · 已刷新 {ctx.refreshStamp}
{iconRow.map(([v, label]) => ( ))}
今天
{today.length === 0 ? (
今天暂无任务
) : (
    {today.map((t) => { const done = t.status === "completed" || t.status === "merged"; const time = t.updated_at ? new Date(t.updated_at * 1000).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ""; return (
  • { ctx.showDetail(t.id); onSelect("task"); }}> {done ? "✓" : ""} {String(t.prompt || shortId(t.id)).slice(0, 60) || shortId(t.id)} {shortId(t.id)} · {t.status} · {t.executor || ""} {time}
  • ); })}
)}
{view === "task" ? "任务详情" : "模块详情"} {context}
); }