feat(tasks): add copy queue controls and task visibility - #629
Open
fryeggs wants to merge 2 commits into
Open
Conversation
Co-Authored-By: OpenAI Codex <noreply@openai.com>
19 tasks
Co-Authored-By: OpenAI Codex <noreply@openai.com>
pikachuren
reviewed
Aug 19, 2026
pikachuren
left a comment
Collaborator
There was a problem hiding this comment.
🙏 感谢 @fryeggs 提交!
🤖 AI 自动审核声明:本评审报告由 AI 自动生成,当前使用 DeepSeek-V4-Pro 模型进行分析。
📖 概要:feat(tasks): add copy queue controls and task visibility · 关联后端 OpenList#2914 · 为大型复制队列增加管理员暂停/恢复控制与任务可见性改进
核心改动:新增 CopyQueueControl(管理员暂停/恢复排队复制)、运行/等待计数与"只看运行中"过滤、done 任务按完成时间排序并 10s 自动刷新、登录页主按钮左移、非英语缺键回退英语。
📋 评分:功能 ⭐⭐⭐⭐ | 最小改动 ⭐⭐⭐ | 前向兼容 ⭐⭐⭐⭐ | 方案 ⭐⭐⭐
关键问题(按重要性):
⚠️ Tasks.tsx:58新增const TaskState重复硬编码状态值,但Task.tsx已有enum TaskStateEnum(0-9)且未导出 → 建议导出并复用,避免两处魔法数字漂移- 💡
Copy.tsx:69refresh()在组件函数体内直接调用副作用 → 建议改用onMount(refresh),避免未来 StrictMode/HMR 下重复请求 - 💡
Copy.tsxworker 上限<= 32硬编码,与后端copy_task_threads_num约束耦合 → 建议确认后端上限一致,或抽常量注明来源 - 💡
Copy.tsxtoggleQueue按钮仅设loading未设disabled,快速连点可能并发提交 → 建议补disabled={saveSettingLoading()}
📂 文件分析(仅问题文件):
Tasks.tsx:⚠️ L58 状态枚举重复定义 → 复用TaskStateEnum;✅props.done === "done"修复 truthy bug 正确Copy.tsx:⚠️ 组件体直接调用refresh();💡 worker 上限硬编码、toggle 缺并发保护Task.tsx:✅ 明确区分 done/undone 分支,修复逻辑正确
🎯 结论:🔄 Request Changes — 建议复用现有 TaskStateEnum 消除状态值重复定义后再合并,其余为可选优化
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
This PR improves the task page for large copy queues and adds an administrator-only pause/resume control for queued copy work. Running and waiting counts are visible, running tasks can be isolated, unfinished tasks refresh frequently, completed tasks refresh and sort by completion time, and non-English locales fall back to English for newly added keys.
本 PR 面向大型复制队列改进任务页面,并为管理员增加排队复制任务的暂停/恢复控制。页面显示运行中/等待中数量,可只查看运行任务;未完成任务高频刷新,已完成任务按完成时间刷新和排序;非英语语言缺少新键时自动回退到英语。
登录页的主操作现在位于左侧:
登录使用主按钮样式,清除位于右侧并使用次要样式,降低误操作风险。Related repository PRs / 关联仓库 PR:
Testing / 测试
pnpm exec prettier --check src/app/i18n.ts src/lang/en/tasks.json src/pages/manage/tasks/Copy.tsx src/pages/manage/tasks/Task.tsx src/pages/manage/tasks/Tasks.tsxpnpm buildsrc/pages/login/index.tsx.Checklist / 检查清单
prettier.AI Disclosure / AI 使用声明
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Tests / 测试
Translation / 翻译 fallback keys
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
I have ensured that this AI-assisted commit includes
Co-Authored-Byattribution.I can reproduce the checked behavior from the committed source and test commands without relying on hidden runtime state.