Files
AgentLab/frontend/src/pages/NotFound.tsx
T
ThearchyHelios 03c18c4d78 界面文案整改:口语改书面、术语统一、不再露出实现细节;修掉几处说错的提示;新增文案检查防回潮
一、文案(前端约 1600 处,后端传到界面的约 880 处)
- 术语统一:工作流层面用「运行」(继续运行、重新运行、试运行),节点和工具层面用「执行」,不再用「跑」;
  总时长 / 执行时长 / 等待审批;服务端;助手;Agent;token;工作流;固定版本;模型接入;系统提示;批准 / 驳回;受管级别
- 口语改书面:取不到、没取回来、读不懂、连不上、多半、照样、兜底、揉成这类说法改成「无法 / 未能 / 失败 / 请」;去掉拟人写法
- 不再露出实现细节:界面上不写 checkpoint、同一拍、哈希(凭证处除外),不写改版历史(「以前…」「老数据」);
  报错、校验、门禁、自动修复里裸写的配置键名和枚举值换成界面上的中文标签,由新的 backend/app/engine/labels.py 统一提供;
  发布弹窗里结论句的选项不再是 off / require_citation
- 同一件事只留一种说法:生成阶段文案、出具档位说明、画布锁定提示各合成一份
- 去掉界面上的工业场景示例(MES、ERP、「张工」「王工」)和真实产品名,换成通用示例

二、说错的提示(都有测试证明)
- 数据库测连接失败时的专用提示以前从不出现(按报错文字全等比较,永远比不上):改为按错误类型判断,不再拼出重复的前缀
- 「设置 → 供应商」改指「设置 → 模型接入」;「在设置里建数据源」改指「数据」页
- 缺少 API Key、模型接入已停用的报错不再夹英文,写明去哪里填
- 两处原因说错(「这种引用在后续版本支持」「这一版还不支持」)改成真实原因
- 节点说明里不准确的说法改正:代码节点在 microVM 或系统沙箱中执行;报告撰写、口径卡的说明不再说过头
- 导出的证据 CSV 里两列同名,第三列改为「片段编号」

三、前后端对齐
- 前端按后端原文识别日志、报错的地方,新旧两种写法都认得(历史运行里存的是旧文字),逐条补了新旧原文的核对
- 后端交回模型的原指令放进单独的 for_model 字段,前端在解析响应时去掉,不会显示到界面上

四、检查
- 检查脚本里按原文匹配的断言改成新文案;改完会变成永远成立的反向断言逐条修正,并做了变异验证
- 新增 check-copy(静态扫描前端界面字符串和后端上界面的文案):再出现「跑」「后端」「多半」「令牌」、
  界面上的 Copilot、裸写的配置键名、半角标点等就报错;确需保留的写进 scripts/copy-allow.json 并注明理由
2026-09-30 08:05:15 +08:00

63 lines
3.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Link, useLocation, useNavigate } from 'react-router-dom'
import { ArrowLeft, Search } from 'lucide-react'
import { Kbd } from '../components/ui'
import { openCommandPalette } from '../components/CommandPalette'
import { usePageTitle } from '../lib/notify'
/**
* 未知地址。之前路由表没有兜底,打错地址或点了过期链接看到的是一整块空白,
* 导航也不高亮任何一项——不知道是页面坏了、还是自己走错了。
*/
export function NotFound() {
const { pathname, search } = useLocation()
const navigate = useNavigate()
usePageTitle('页面不存在')
// 从站外直接打开的过期链接没有「上一页」可回
const canGoBack = typeof window !== 'undefined' && (window.history.state?.idx ?? 0) > 0
return (
<div className="flex h-full items-center justify-center overflow-auto p-8">
<div className="flex max-w-md flex-col items-center text-center">
<BrokenRoute />
<div className="mono mt-5 text-2xs tracking-[0.2em] text-faint">404 · NOT FOUND</div>
<h1 className="mt-1.5 text-xl font-semibold text-fg">这个地址不存在</h1>
<p className="mt-2 text-sm leading-relaxed text-dim">链接可能已失效,或地址有误。</p>
<code
className="mono mt-3 max-w-full truncate rounded-md border bg-elev px-2 py-1 text-xs text-dim"
title={pathname + search}
>
{pathname}{search}
</code>
<div className="mt-6 flex flex-wrap items-center justify-center gap-2">
<Link to="/chat" className="btn btn-primary">回到问数据</Link>
<button type="button" className="btn" onClick={openCommandPalette}>
<Search size={13} aria-hidden /> 搜索页面 <Kbd combo="Mod+K" className="ml-1" />
</button>
{canGoBack && (
<button type="button" className="btn btn-ghost" onClick={() => navigate(-1)}>
<ArrowLeft size={13} aria-hidden /> 返回上一页
</button>
)}
</div>
</div>
</div>
)
}
/**
* 走线断在半路:和品牌标同一种正交折线,终点那个节点是虚线框——
* 画布上「未到达」就是这副样子。静态,不做动画。
*/
function BrokenRoute() {
return (
<svg width="148" height="64" viewBox="0 0 148 64" fill="none" aria-hidden className="text-faint">
<rect x="6" y="22" width="20" height="20" rx="4" stroke="var(--accent)" strokeWidth="1.75" fill="var(--accent-soft)" />
<path d="M26 32H58V14H84" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" />
<rect x="84" y="4" width="20" height="20" rx="4" stroke="currentColor" strokeWidth="1.75" />
<path d="M58 32V50H78" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeDasharray="3 4" />
<rect x="116" y="40" width="20" height="20" rx="4" stroke="var(--st-unreached, currentColor)" strokeWidth="1.5" strokeDasharray="3 3" />
<path d="M122 46l8 8M130 46l-8 8" stroke="var(--st-unreached, currentColor)" strokeWidth="1.5" strokeLinecap="round" />
</svg>
)
}