fix: replace raw codes and internal IDs in the console with Chinese labels
Found in v0.2 visual QA (docs/plan/09-visual-qa.md): - actor strings (admin_session:<uuid>, user:<uuid>, system) -> 管理员/系统/API Key in policy revisions, subscriptions, inbox, trash, business tasks, organize detail - cache volume without key shows the downloader name instead of instance:<uuid> - download timeline/plan: task and organize statuses, plan purpose, priority and status reason localized; audit gets labels for capability/files/site/feed actions - organize record reason uses conflict detail (没有可入库的主视频) instead of blocked:no_main_video; slot/candidate reasons drop inflight:<uuid> - identity decision summary no longer shows no_viable_candidate - upstream test: 'Connection error.' classified as network, with a Chinese hint - new policy draft prefills key default (placeholder looked like a value) - dialog/sheet close sr-only text in Chinese Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d7eb6a45d0
commit
46d37d87fe
23 files changed
+176
-43
No files matched your search
@@ -18,6 +18,15 @@ const ERROR_KIND: Record<string, string> = {
|
||||
other: "失败",
|
||||
};
|
||||
|
||||
const SOURCE_TEXT: Record<string, string> = { "stored credential": "已存凭证" };
|
||||
|
||||
/** 上游返回的多是英文原文:先给一句怎么办,原文留作排查 */
|
||||
const ERROR_HINT: Record<string, string> = {
|
||||
network: "连不上上游,检查 Base URL、端口和网络",
|
||||
auth: "凭证被拒,检查 API Key 或重新订阅登录",
|
||||
model: "模型不可用,换一个模型 id",
|
||||
};
|
||||
|
||||
export function PiTestPanel({ upstream, model }: { upstream: PiUpstream; model?: string | null }) {
|
||||
const test = useTestPiUpstream();
|
||||
const [result, setResult] = useState<PiUpstreamTestResult | null>(null);
|
||||
@@ -60,10 +69,13 @@ export function PiTestPanel({ upstream, model }: { upstream: PiUpstream; model?:
|
||||
</StatusBadge>
|
||||
<span className="text-muted-foreground">
|
||||
{result.latencyMs} ms{result.model ? ` · ${result.model}` : ""}
|
||||
{result.source ? ` · ${result.source}` : ""}
|
||||
{result.source ? ` · ${SOURCE_TEXT[result.source] ?? result.source}` : ""}
|
||||
</span>
|
||||
{!result.ok && result.message ? (
|
||||
<span className="w-full break-words text-destructive">{result.message}</span>
|
||||
<span className="w-full break-words text-destructive">
|
||||
{ERROR_HINT[result.errorKind ?? ""] ? `${ERROR_HINT[result.errorKind ?? ""]}。原始错误:` : ""}
|
||||
{result.message}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
Reference in new issue
Block a user