Commit Graph

197 Commits

Author SHA1 Message Date
f90b0a4f11 Harden auth, CSRF, and email log UX 2025-12-26 19:05:42 +08:00
Yu Yon
3214cbbd91 chore: ignore local data and compose backups 2025-12-25 00:39:14 +08:00
Yu Yon
c32f7b797d chore: add API diagnostic request logging toggles 2025-12-24 19:26:50 +08:00
ec84903745 fix: 启动后60秒内所有请求使用15秒超时
问题:之前的 _first_request 只对第一个HTTP请求有效,但login()
需要两次请求(GET登录页+POST登录),导致实际的POST登录
请求仍然只有5秒超时,在冷启动时容易失败。

修复:改为基于模块启动时间的超时策略
- 启动后60秒内:所有请求使用15秒超时
- 60秒后:恢复正常的5秒超时

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:42:03 +08:00
151fc3e09f perf: 启动预热优化 - 解决容器重启后首批任务慢/失败
问题:容器重启后前两批任务明显变慢或失败
- 第一批:代理/目标服务器连接冷启动导致超时
- 第二批:浏览器池冷启动需要创建浏览器

解决方案:
- browser_pool_worker.py: 添加 pre_warm 参数,启动时预创建1个浏览器
- api_browser.py: 添加 warmup_api_connection() 预热 TCP/TLS 连接
- api_browser.py: 首次请求使用更长超时(10s),后续恢复正常
- app.py: 启动时后台调用 API 预热

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:18:18 +08:00
1d44859857 perf: 优化任务执行速度 (40-70s → ~15s)
问题:容错机制引入了大量叠加的等待时间

优化内容:
- playwright_automation.py:
  - 登录超时 30s → 10s
  - 导航等待 2s → 0.5s
  - navigate_only 等待 1s → 0.3s
  - 首页轮询 8次×3s → networkidle + 2次×0.5s
- services/tasks.py:
  - 删除截图前固定 sleep(2)
- services/screenshots.py:
  - networkidle 超时 30s → 10s
  - selector 超时 20s → 5s

预计性能提升:从 40-70 秒降至约 15 秒

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:19:46 +08:00
79a571e58d fix: 容器重启后第一批任务失败
问题:容器重启时账号对象的 is_running 状态未被重置,
导致新任务提交时被拒绝("任务已在运行中")

修复:在启动流程中添加遗留任务状态清理逻辑
- 重置所有账号的 is_running/should_stop/status
- 清理活跃任务句柄

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:32:20 +08:00
5f4fb50001 refactor: 统一日志管理 + 数据库索引优化
- db/schema.py: 添加 4 个复合索引优化查询性能
  - idx_user_schedules_user_enabled
  - idx_schedule_execution_logs_schedule_id/user_id/status
- db/users.py: print → logger,密码升级日志改为记录 user_id
- crypto_utils.py: print → logger
- password_utils.py: print → logger

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:57:03 +08:00
c5f019be5a chore: restore API request timeout 5s 2025-12-18 09:46:01 +08:00
433a3cb806 fix: avoid blocking browser init 2025-12-18 09:38:02 +08:00
5851120f87 fix: admin auth UX, password policy, deps, db pool 2025-12-17 23:53:11 +08:00
9028f7e272 ui: 移除定时任务停用标签 2025-12-17 22:12:06 +08:00
2ef0a10d6f fix(ui): 开关可见与布局对齐 2025-12-17 22:03:15 +08:00
2f5940d339 fix(ui): 开关可见与卡片不拉伸 2025-12-17 21:14:54 +08:00
db4201a269 fix(ui): 定时任务开关禁用态更清晰 2025-12-17 20:44:49 +08:00
5393648d21 fix(api): 列表页失败不算完成 2025-12-17 19:24:08 +08:00
3f667dd21b fix(api): 超时按单条处理避免中途结束 2025-12-17 15:49:05 +08:00
6827d11f40 chore(update): 忽略备份文件的脏工作区提示 2025-12-16 23:48:58 +08:00
4c9bed0f0b perf: 默认请求超时降为5s 2025-12-16 23:17:21 +08:00
Yu Yon
4571a83492 chore: 使用国内DNS避免解析超时 2025-12-16 22:25:41 +08:00
0e587ca497 ui: 运行中仅显示已浏览内容数 2025-12-16 21:23:03 +08:00
1b707fdace fix: 浏览内容进度实时显示 2025-12-16 21:19:48 +08:00
2abb9ab494 fix: 账号截图开关持久化与状态推送优化 2025-12-16 18:27:45 +08:00
e699f4fb94 更新管理后台布局 2025-12-15 22:18:44 +08:00
d650c6f584 优化报表页面,移除统计页面 2025-12-15 22:12:15 +08:00
9aa28f5b9e 添加报表页面,更新用户管理和注册功能 2025-12-15 21:39:32 +08:00
738eaa5211 更新邮件服务和SMTP配置功能 2025-12-15 20:32:28 +08:00
8846945208 更新邮件页面和管理API 2025-12-15 17:16:56 +08:00
49897081b6 更新日志页面和统计页面
- 更新 LogsPage 和 StatsPage 组件
- 添加 taskSource 工具模块
- 更新 db/tasks.py
- 重新构建前端静态资源
2025-12-15 16:25:37 +08:00
a8b9f225bd 更新系统页面和更新功能
- 更新 admin-frontend 系统页面和更新 API
- 更新 routes 和 services 中的更新逻辑
- 重新构建前端静态资源
2025-12-15 15:58:12 +08:00
de6d269fb4 更新 update_agent.py 2025-12-15 15:09:34 +08:00
0d1397debe 添加自动更新功能 2025-12-15 14:34:08 +08:00
809c735498 添加一键部署脚本 2025-12-15 13:57:25 +08:00
10d5363e29 更新 schedules.py 2025-12-15 13:30:40 +08:00
a619e96e73 同步本地更改 2025-12-15 10:48:58 +08:00
dab29347bd 更新定时任务页面和前端构建 2025-12-14 23:09:27 +08:00
1ec0d80f6c 清理冗余文件,更新 Dockerfile 和配置 2025-12-14 22:49:00 +08:00
dac06d187e 更新 playwright_automation 和 screenshots 服务 2025-12-14 22:04:05 +08:00
a346509a5f 同步更新:重构路由、服务模块,更新前端构建 2025-12-14 21:47:46 +08:00
e01a7b5235 删除 UI_REFACTOR_FRONTEND.md 2025-12-14 18:24:34 +08:00
949ff1e53a 删除 UI_REFACTOR_ADMIN.md 2025-12-14 18:24:29 +08:00
cbddaf810e fix: 直接对iframe内容进行full_page截图
使用iframe.screenshot(full_page=True)来截取iframe内的完整内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:23:05 +08:00
a3497f2921 fix: 展开所有可滚动容器以截取完整页面内容
在截图前通过JavaScript展开所有带overflow的容器,确保full_page能够捕获全部内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:17:51 +08:00
94ceb959c7 fix: 使用JavaScript展开iframe高度以截取完整内容
在截图前通过JavaScript动态调整iframe及其父容器的高度,使其能够显示全部内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:11:58 +08:00
b408e78c74 fix: 改进截图逻辑,直接截取表格元素
尝试截取table.ltable元素来获取完整内容,而不是依赖full_page参数。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:08:41 +08:00
4400ded86a fix: 修复截图只截取可见区域的问题
改为对iframe内容进行截图而不是主页面,这样full_page=True才能正确截取iframe内的完整内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:04:36 +08:00
4510fbba83 fix: 修复截图只能截取区域的问题,改为截取整个网页内容
将 full_page=False 改为 full_page=True,使截图能够捕获完整的网页内容而不仅仅是可见区域。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:49:49 +08:00
a9c8aac48f fix: 账号页闪烁/浏览类型/截图复制/时区统一 2025-12-14 11:30:49 +08:00
2ec88eac3b fix(app): refine account progress and screenshots 2025-12-14 01:21:31 +08:00
8931ad5d7f fix(app): screenshot copy button copies image; add copy link 2025-12-14 00:59:02 +08:00