study-tool
cfa960221e
feat(web): 插件管理弹窗(启停 / 重载)
...
- 顶栏新增「插件管理」图标按钮,打开 PluginsDialog
- 弹窗列出 pugins/ 下的插件:标题 / 目录名 / 是否启用与已加载 / 平台 label / 能力清单
- 每个插件可启用、停用、重载,底部有「全部重载」
- 启停成功后重新拉 /api/platforms,「添加账号」的平台下拉同步刷新
- types.ts 新增 PluginInfo;App.tsx 把平台列表加载提成 loadPlatforms 复用
- static/ 重新构建(pnpm typecheck + pnpm build 均通过)
- 顺带把 .vscode/ 纳入跟踪
2026-10-31 16:01:44 +08:00
study-tool
f8458cff51
feat(plugins): 插件支持热加载与启用/停用清单
...
- pugins/__init__.py 重写:load_plugins / discover / set_enabled / reload
- 热加载:把 study_tool.pugins.<名字> 的模块从 sys.modules 摘掉后重新 import;
重载前先 registry.unregister 旧 id,平台 id 改了也不会留残影
- 启用清单存设置项 plugins({"disabled": [...]}):未列出的默认启用,新插件自动生效;
停用即从注册表摘掉,/api/platforms 与账号平台下拉同步消失
- platforms/registry.py 新增 unregister(pid)
- 新接口:GET /api/plugins、POST /api/plugins/{name}/enable|disable、
POST /api/plugins/reload、POST /api/plugins/{name}/reload;失败返回 ok=false
- 同步 docs/pugin.md(新增「加载与启停」)、docs/architecture.md、docs/OPTIMIZATION.md、AGENTS.md
2026-10-31 15:50:06 +08:00
study-tool
f1a57853f4
refactor(plugins): gdgxk 迁到 pugins/gdgxk,插件由目录扫描加载
...
- platforms/gdgxk.py → pugins/gdgxk/main.py(实现不变,仍是 class Gdgxk(Platform))
- pugins/gdgxk/pugin.json 只放注册信息 id / title / name,不声明任何能力绑定
- pugins/__init__.py:load_plugins() 扫 pugins/*/pugin.json、import 各自的 main.py,
再用 pugin.json 的 id 校验注册结果;要换加载方式只改这一个函数
- platforms/__init__.py::load_builtin() 调 load_plugins();guanyixue 依赖 jspx/study,
暂留 platforms/
- engine / routes / quiz / contract / 前端未改动
- 同步 AGENTS.md、docs/architecture.md、docs/OPTIMIZATION.md
2026-10-31 15:41:22 +08:00
study-tool
bdd0bdf073
refactor(platforms): 平台插件改为 Platform 子类形态
...
Platform 由 dataclass 改为普通基类(类属性 + 方法槽位),禁止逐项传函数注册;gdgxk 与 guanyixue 完成迁移;AGENTS.md、architecture.md 同步新契约;新增 docs/pugin.md(骨架 / 槽位契约 / 开发与迁移流程 / 常见坑),OPTIMIZATION.md 补待测条目。
2026-10-31 15:07:25 +08:00
study-tool
f999e4fa4d
refactor(platforms): 平台能力改为子类实现,注册不再逐项绑定函数
...
- Platform 由 dataclass 字段绑定改为基类:id / label / entries 是类属性,能力是子类方法,
未实现的阶段保持基类 None,capabilities() 与 /api/platforms 输出不变
- gdgxk:session(原 new_session)/ login / list_courses / discover / study / _relogin
收进 class Gdgxk(Platform),解析与上报 helper 仍是模块级函数
- guanyixue:改成 class Guanyixue(Platform),方法转调 jspx / study
- 删除 src/study_tool/pugins/ 草稿目录(内容与 platforms/gdgxk.py 重复,
pugin.json 里按名字声明 study / entries 的绑定方式作废,元数据改由类属性承载)
- 引擎 / 路由 / quiz / contract / 前端未改动
- 同步 docs/architecture.md、AGENTS.md、docs/OPTIMIZATION.md
2026-10-31 15:02:21 +08:00
study-tool
b1ccfe89f6
docs: 插件改为 Platform 子类形态,更新 pugin.md 契约与迁移步骤
2026-10-31 14:56:10 +08:00
study-tool
53bddbabaa
docs: 按 json 驱动的插件方案更新 pugin.md
...
确定 pugin.json 为唯一权威:加载器读 json 注册,main.py 只提供函数;补加载器流程、schema 校验规则、迁移待办。
2026-10-31 14:51:42 +08:00
study-tool
a6aa6a88f9
docs: 沉淀插件目录方案与开发流程(docs/pugin.md)
2026-10-31 14:43:15 +08:00
study-tool
7259ab8d96
refactor(platforms): 学习流程下沉到平台层,engine 只保留编排
...
SessionExpired 移到 platforms/errors.py;旧版流程(_study_builtin)搬到 jspx.py,新版 SPA 流程(run_study_course + 视频)搬到 study.py;engine.py 只剩账号级编排,不再 import 具体平台;routes/quiz 去掉平台 star import,session/dump_cookies 缺失时明确报错。顺带修复学习链路三处未定义全局名(jspx/study/quiz)。
2026-10-31 14:21:36 +08:00
study-tool
d702830470
feat(platforms): 增加能力推导与 /api/platforms capabilities 字段
...
新增 platforms/contract.py:生命周期 ↔ 槽位 ↔ 能力名映射,capabilities_of 按非空槽位推导;Platform.capabilities() 供 /api/platforms 返回 capabilities。行为不变,现有流程与前端未改。同步 architecture.md(生命周期与能力、广东公需课)、todo 第二/三步、OPTIMIZATION 平台列表。
2026-10-31 13:54:28 +08:00
study-tool
0e2923e675
fix: 重新登录后清掉上一轮已结束的运行状态
...
- 服务重启留下的「已中断」状态会在登录后继续压着卡片徽标、挂着旧进度和红条
- 登录成功后清掉该账号已结束的运行状态(内存 + run_state 表),正在跑的不动,内存日志保留
- 新增 store.run_state_delete(),/api/run 轮询随即把 run 置空,徽标回到「已登录」
2026-10-31 01:00:57 +08:00
study-tool
e6515fe278
fix: 运行状态与日志三处修复;依赖改用 uv 锁 + 国内镜像
...
- 重启标记不再污染新一轮运行:hydrate_runs() 标记「已中断」后立即落库,runtime.set_state() 在切入 discovering/studying 时清掉上一轮的 error/progress/finished_at
- 服务重启后卡片「课程日志」能读到 SQLite 历史:前端兜底条件不再拿 status 是否为空做判断(重启后 status 恒为 interrupted)
- 删除账号连带清日志:account_delete() 按账号 id + 用户名清 run_state/run_log/login_log,删除接口同时清内存里两个 key
- 新增 uv.lock 依赖锁定;pyproject 走阿里云 PyPI 镜像,Dockerfile 支持 PIP_INDEX_URL 构建参数
- 文档移入 docs/,.gitignore 忽略 *.egg-info/(uv run 可编辑安装产物)
2026-10-31 00:53:40 +08:00
study-tool
c4bc97dd70
feat(gdgxk): 课程卡片显示培训年度 / 学时 / 完成状态
...
- list_courses 解析 showCourse 卡片里的「培训年度」「课程学时」「未完成/已完成」,
返回 section / info / status_label,前端拼成「2026年公需课 · 未完成 · 30 学时」
- 修正完成判定:以平台状态为准(需所有教学活动 100% + 试卷考核 ≥60),
不再用视频秒数够不够来推断,避免把未完成的课当已学完跳过
2026-10-30 22:33:46 +08:00
study-tool
31f7020190
fix(gdgxk): 打通登录全链路(图形验证码 OCR + 正确换票入口)
...
- 登录要过 4 位图形验证码:readCaptcha 返回 data:image/png;base64,用 ddddocr 识别,
失败按登录页 #errorText 判断原因并最多重试 5 次
- 换票入口纠正:票按 ITLMS-xxx||ticketId 两段 GET /nts/loginToStoreByAccount,
之前直接带 ?ticket= 访问 courseRegister 是无效的
- requirements / pyproject 增加 ddddocr;文档同步实测结论
2026-10-30 22:30:32 +08:00
study-tool
16346159c2
feat: 接入广东公需课平台(jsglpt 登录 + jsxx 进度心跳)
...
- 新增 platforms/gdgxk.py:base64 登录 → ssoItlmsGxkTicket 换票进 jsxx →
/uc/store/courseRegister 取课程 → updateViewTime1 心跳上报进度(无需真播)
- platforms/__init__.py 注册;配套抓包脚本与自测脚本
- CHANGELOG / OPTIMIZATION / todo 同步,版本升到 0.0.2
2026-10-30 22:17:47 +08:00
study-tool
1a3347f7f9
feat: 添加账号支持选择学习平台
...
账号新增 platform 字段,登录/刷新课程/发现课程按平台分发;同时把 JS 脚本收进 script/(目录规范调整)。
2026-10-30 01:13:47 +08:00
study-tool
e8634a6317
refactor: React 前端重构,新旧平台合并为莞易学
2026-10-29 23:53:17 +08:00
study-tool
35853891c9
fix: 页面标题改为莞易学,容器内固定国内 DNS
...
- static/index.html:标题与页头 h1 由「多账号学习控制台」改为「莞易学」
- docker-compose.yml:容器固定 223.5.5.5 / 119.29.29.29,绕过宿主机不可用的 1.1.1.1 上游
2026-10-28 20:41:44 +08:00
study-tool
549a91af1d
fix: 首次进入课程自动同步加入(syncSelf)
...
首次进入课程时课时树回 code=500「你还没有加入学习…」,前端把它渲染成挡路弹层,
人工点掉后 SPA 自己补发 syncSelf 才落库 —— 所以第二次进同一门课就正常。
- discover_study 返回值补 course_code(trainCourse/getById.courseCode)
- 新增 study_mod_get:/mod/* 只带 cookie + Referer,不带 Bearer
- 新增 study_sync_self:GET /mod/school/wanpeng/syncSelf?courseCode=…
- 新增 study_sync_identity:GET /mod/gjt/roleList 补一刀身份
- ensure_study_join 改为:已加入 → student/join → syncSelf + 轮询 getById → 刷新 jspx 页
- todo.md 收尾,新增 OPTIMIZATION.md 记录待实测确认项
2026-10-28 20:41:44 +08:00
study-tool
ba23888771
docs: add CHANGELOG and metadata for v0.0.1
2026-10-27 22:36:04 +08:00
study-tool
585a7a28dd
feat: study modes (fast/parallel) and course-container completion fix
...
- settings: study.mode fast|normal and study.parallel 1-5
- normal mode: one headless browser per video, visibility keep-alive, auto-degrade when the platform enforces order
- report study/log/detail/save before isComplete; drop lastProgressTime on completion
- complete periodType 10/13 container nodes and recompute counters via PUT calFinalScore
- capture mode: POST /api/capture records all XHR/fetch including new tabs
- UI: study mode in settings, capture / stop-capture menu items
2026-10-27 22:30:57 +08:00