copy(web): api 标签与整理状态统一
整理记录状态改为排队中 / 整理中 / 已整理 / 部分整理 / 整理失败(列表摘要、组汇总、队列面板同口径); 下载计划「等你批准」「准备提交」;资源评估「可下载」「信息不全」「已跳过」;任务状态带「中」; 识别等待提示改匹配「TMDB 结果在后台查询」。 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
148b12f279
commit
592f40ccf8
23 files changed
+58
-59
No files matched your search
@@ -344,8 +344,8 @@ export const REPORT_STATE: Record<
|
||||
{ label: string; tone: "success" | "warning" | "destructive" | "neutral" }
|
||||
> = {
|
||||
no_actions: { label: "没有产生业务动作", tone: "neutral" },
|
||||
waiting: { label: "已提交,等待下载/整理", tone: "warning" },
|
||||
completed: { label: "已核验整理", tone: "success" },
|
||||
waiting: { label: "已提交,等下载和整理", tone: "warning" },
|
||||
completed: { label: "已整理", tone: "success" },
|
||||
partial: { label: "部分完成", tone: "warning" },
|
||||
failed: { label: "未达成", tone: "destructive" },
|
||||
};
|
||||
|
||||
@@ -205,7 +205,7 @@ export function useDownloaderNames() {
|
||||
}
|
||||
|
||||
export const DOWNLOAD_STATUS_LABEL: Record<DownloadStatus, string> = {
|
||||
queued: "排队",
|
||||
queued: "排队中",
|
||||
submitting: "提交中",
|
||||
downloading: "下载中",
|
||||
paused: "已暂停",
|
||||
@@ -215,7 +215,7 @@ export const DOWNLOAD_STATUS_LABEL: Record<DownloadStatus, string> = {
|
||||
imported: "已整理",
|
||||
failed: "失败",
|
||||
removed: "已移除",
|
||||
missing: "下载器中缺失",
|
||||
missing: "下载器里找不到",
|
||||
};
|
||||
|
||||
export const DOWNLOAD_STATUS_TONE: Record<DownloadStatus, "success" | "warning" | "destructive" | "neutral"> = {
|
||||
@@ -234,14 +234,14 @@ export const DOWNLOAD_STATUS_TONE: Record<DownloadStatus, "success" | "warning"
|
||||
|
||||
export const PAUSE_REASON_LABEL = {
|
||||
user: "手动暂停",
|
||||
threshold: "下载盘满暂停",
|
||||
threshold: "因下载盘暂停",
|
||||
policy: "策略暂停",
|
||||
agent: "智能体暂停",
|
||||
} as const;
|
||||
|
||||
export const PLAN_STATUS_LABEL: Record<PlanStatus, string> = {
|
||||
draft: "待批准",
|
||||
reserved: "已预留空间",
|
||||
draft: "等你批准",
|
||||
reserved: "准备提交",
|
||||
submitted: "已提交",
|
||||
completed: "已完成",
|
||||
cancelled: "已取消",
|
||||
|
||||
@@ -19,12 +19,12 @@ export function useInventory(entityIds: string[]) {
|
||||
export type OverlayFlag = { key: string; label: string; tone: "success" | "warning" | "neutral"; title?: string };
|
||||
|
||||
const DECISION_FLAG: Record<string, { label: string; tone: OverlayFlag["tone"] }> = {
|
||||
accept: { label: "已选中", tone: "success" },
|
||||
accept: { label: "可下载", tone: "success" },
|
||||
upgrade: { label: "可升级", tone: "success" },
|
||||
reject: { label: "未选", tone: "warning" },
|
||||
unknown_field: { label: "字段未知", tone: "warning" },
|
||||
skipped: { label: "被跳过", tone: "neutral" },
|
||||
deferred: { label: "延后", tone: "neutral" },
|
||||
unknown_field: { label: "信息不全", tone: "warning" },
|
||||
skipped: { label: "已跳过", tone: "neutral" },
|
||||
deferred: { label: "延后:已有下载在进行", tone: "neutral" },
|
||||
};
|
||||
|
||||
/** 该资源在各 Slot 上的最近一次评估(服务端每个 (Slot, 资源) 只保留一条) */
|
||||
|
||||
@@ -38,7 +38,7 @@ export function parseOrThrow<S extends z.ZodType>(schema: S, data: unknown, path
|
||||
console.warn(`[api] ${path} 响应结构不符`, r.error.issues);
|
||||
throw new ApiRequestError(
|
||||
"internal",
|
||||
`接口 ${path} 返回的数据结构不符(${first?.path.join(".") || "根"}: ${first?.message ?? "未知"})`,
|
||||
`接口 ${path} 返回的数据结构不符(${first?.path.join(".") || "(root)"}: ${first?.message ?? "未知"})`,
|
||||
);
|
||||
}
|
||||
return r.data;
|
||||
|
||||
@@ -47,8 +47,7 @@ export async function fetchAllCursorPages<P extends { items: unknown[]; nextCurs
|
||||
const seen = new Set<string>();
|
||||
let cursor = first.nextCursor;
|
||||
while (cursor) {
|
||||
// copy-allow: 用词规则上线前已有,文案归其它路改
|
||||
if (seen.has(cursor)) throw new ApiRequestError("internal", "分页游标重复,请重试");
|
||||
if (seen.has(cursor)) throw new ApiRequestError("internal", "分页游标重复。重试");
|
||||
seen.add(cursor);
|
||||
const page = await fetchPage(cursor);
|
||||
items.push(...page.items);
|
||||
|
||||
@@ -160,11 +160,11 @@ export function useOrganize() {
|
||||
}
|
||||
|
||||
export const RECORD_STATUS_LABEL: Record<OrganizationStatus, string> = {
|
||||
queued: "排队",
|
||||
running: "执行中",
|
||||
succeeded: "成功",
|
||||
partial: "部分成功",
|
||||
failed: "失败",
|
||||
queued: "排队中",
|
||||
running: "整理中",
|
||||
succeeded: "已整理",
|
||||
partial: "部分整理",
|
||||
failed: "整理失败",
|
||||
cancelled: "已取消",
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ const DecisionPage = cursorPage(Decision);
|
||||
const RESOLUTION_LABEL = {
|
||||
unresolved: "未识别",
|
||||
resolved: "已识别",
|
||||
ambiguous: "有歧义,待确认",
|
||||
ambiguous: "匹配到多部作品,待确认",
|
||||
unidentifiable: "无法识别",
|
||||
rejected: "已排除",
|
||||
} as const;
|
||||
@@ -99,9 +99,9 @@ export function useRecordsForDownload(downloadTaskId: string | undefined) {
|
||||
}
|
||||
|
||||
const TASK_STATUS_TEXT: Record<string, string> = {
|
||||
pending: "排队",
|
||||
pending: "排队中",
|
||||
running: "运行中",
|
||||
waiting: "等待",
|
||||
waiting: "等待中",
|
||||
succeeded: "成功",
|
||||
failed: "失败",
|
||||
cancelled: "已取消",
|
||||
@@ -111,9 +111,9 @@ const TASK_STATUS_TEXT: Record<string, string> = {
|
||||
const TASK_KIND_LABEL: Partial<Record<TaskKind, string>> = {
|
||||
submitDownload: "提交下载",
|
||||
verifyAndImport: "核验整理",
|
||||
evaluateAcquisition: "评估候选",
|
||||
evaluateAcquisition: "评估资源",
|
||||
cleanupDownloadCache: "清理缓存",
|
||||
resolveDecision: "处理待处理事项",
|
||||
resolveDecision: "处理需要处理的事项",
|
||||
};
|
||||
|
||||
const TASK_STATUS_TONE: Record<TaskStatus, TimelineTone> = {
|
||||
@@ -239,7 +239,7 @@ export function buildTimeline(input: {
|
||||
key: `rec-${r.id}`,
|
||||
stage: "organization",
|
||||
at: r.startedAt ?? r.createdAt,
|
||||
title: `整理 ${organizationActionLabel(r.action)}:${organizationLabel(r.status).label}`,
|
||||
title: `整理 ${organizationActionLabel(r.action)}:${organizationLabel(r.status).label}`,
|
||||
detail:
|
||||
[
|
||||
c.total ? `${c.succeeded}/${c.total} 个文件成功` : null,
|
||||
@@ -259,7 +259,7 @@ export function buildTimeline(input: {
|
||||
key: `dec-${d.id}`,
|
||||
stage: "agent",
|
||||
at: d.createdAt,
|
||||
title: `待处理:${d.title}`,
|
||||
title: `需要处理:${d.title}`,
|
||||
detail: d.summary,
|
||||
tone: d.severity === "critical" ? "destructive" : "warning",
|
||||
href: "/console/inbox",
|
||||
|
||||
Reference in new issue
Block a user