Commit Graph

281 Commits

Author SHA1 Message Date
Copilot
03c7031a3c
Fix task duplication: add single/multi-instance support with UI configuration and stop all running instances (#2837)
* Initial plan

* Stop running tasks before starting new scheduled instance

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add multi-instance support and fix stop to kill all running instances

- Add allow_multiple_instances field to Crontab model (default: 0 for single instance)
- Add validation for new field in commonCronSchema
- Add getAllPids and killAllTasks utility functions
- Update stop method to kill ALL running instances of a task
- Update runCron to respect allow_multiple_instances config
- Backward compatible: defaults to single instance mode

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add UI support for allow_multiple_instances configuration

- Add allow_multiple_instances field to ICrontab interface
- Add instance mode selector in task creation/edit modal
- Add translations for instance mode in Chinese and English
- Default to single instance mode for backward compatibility

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add allow_multiple_instances column migration and optimize db.ts

- Add allow_multiple_instances column to Crontabs table migration
- Refactor migration code to use data-driven approach
- Replace 11 individual try-catch blocks with single loop
- Improve code maintainability and readability

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-19 00:10:27 +08:00
whyour
d01ec3b310 修复 parse cron 2025-11-15 19:09:07 +08:00
whyour
c9fc9b4b45 定时任务支持订阅筛选 2025-11-11 01:24:28 +08:00
whyour
8fdc69421c 修改定时任务支持的排序顺序 2025-11-11 01:02:36 +08:00
whyour
06aa07329f 修复日志目录逻辑 2025-11-09 21:42:45 +08:00
Copilot
c369514741
定时任务支持自定义日志文件或者 /dev/null (#2823)
* Initial plan

* Add log_name field to enable custom log folder naming

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add database migration for log_name column

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add security validation to prevent path traversal attacks

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Apply prettier formatting to modified files

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Support absolute paths like /dev/null for log redirection

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Restrict absolute paths to log directory except /dev/null

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-09 19:32:40 +08:00
whyour
50769c43dd 修复 command-run 接口日志绑定 2025-07-12 20:29:44 +08:00
whyour
1a185f5682 修复创建脚本可能失败 2025-05-20 01:00:08 +08:00
whyour
576408de01 脚本管理增加强制打开文件操作 2025-03-16 17:57:13 +08:00
whyour
fa83761d27 修改定时规则类型 2025-02-21 01:35:08 +08:00
whyour
8173075b67 定时任务支持 @once 和 @boot 任务 2025-02-20 02:18:59 +08:00
whyour
0d9eba4b6e 定时任务外漏标签改为 10 个 2024-10-26 14:49:02 +08:00
whyour
418695c4aa 定时任务支持复制 2024-09-24 23:33:04 +08:00
whyour
66706ce150 修复任务视图过多无法选到视图管理 2024-09-10 22:50:33 +08:00
whyour
8b042d90f3 修复删除日志命令 2024-08-24 22:43:09 +08:00
whyour
a45efbd69b 修复定时任务查询不存在的订阅报错 2024-06-17 23:04:47 +08:00
whyour
805a716033 修复任务详情查看脚本错误 2024-05-25 18:22:01 +08:00
whyour
b309ac7613 修复有可能手动运行任务无日志 2024-05-25 00:28:55 +08:00
whyour
f723631647 修复脚本管理上传文件文件名乱码 2024-04-22 22:39:27 +08:00
whyour
0ae1f284ec 修改脚本详情和日志详情接口 2024-01-29 21:47:03 +08:00
whyour
ca8790bbec 修复任务详情脚本行数展示 2023-12-17 17:53:15 +08:00
whyour
8760ac2964 修复定时任务详情日志列表样式 2023-10-26 23:03:58 +08:00
whyour
b8a9b26ca3 修复定时任务任务前后命令校验 2023-10-12 00:55:22 +08:00
whyour
99f6073c8e 定时任务增加前后规则校验,不能包含 task 命令 2023-10-10 23:06:01 +08:00
whyour
5e73f0390f 修复定时任务详情页查看历史日志异常 2023-10-09 23:56:35 +08:00
whyour
ec5b885476 修改任务队列执行日志 2023-10-06 02:34:40 +08:00
whyour
9d55cb108c 定时任务详情增加额外定时展示 2023-09-29 23:16:07 +08:00
whyour
d3023d31e3 修复定时任务日志滚动 2023-09-27 23:04:16 +08:00
whyour
eddc03e295 修复定时任务间隔较小,任务状态不准确 2023-09-26 22:51:33 +08:00
whyour
22eedebf14 修复任务管理创建视图 2023-09-24 00:47:56 +08:00
whyour
ab3fc9b5f1 定时任务增加运行任务前和运行任务后参数 2023-09-19 22:44:32 +08:00
whyour
acc7443004 定时任务支持多个定时规则 2023-09-16 00:15:50 +08:00
whyour
042d7d3b8e 修复任务管理创建视图 placeholder,更新 npm 包 2023-09-15 21:27:53 +08:00
whyour
0511a4af0d 增加 QlPort 环境变量,支持设置服务启动的端口,修复定时任务视图操作符筛选 2023-09-15 17:57:28 +08:00
whyour
748a099087 修复日志滚动逻辑 2023-09-12 22:28:26 +08:00
whyour
2081364325 修改定时任务置顶样式 2023-09-02 00:41:13 +08:00
whyour
e7be4999b0 修复定时任务日志滚动 2023-08-25 09:05:32 +08:00
whyour
5907553670 修改定时任务置顶样式 2023-08-25 00:46:28 +08:00
whyour
0b9066525a 修复任务运行错误时没有日志,修改 tooltip 样式 2023-08-24 23:14:22 +08:00
whyour
40e8041401 修复退出调试自动删除调试日志目录 2023-08-22 22:18:18 +08:00
whyour
b002cbef3a 修复手机端日志弹框样式 2023-08-19 09:29:35 +08:00
whyour
2d936f1341 修复定时任务页面样式 2023-08-17 08:26:48 +08:00
whyour
b40673e9ac 修改日志弹框样式 2023-08-16 22:14:45 +08:00
whyour
a9b9c4d7ad 修复错误信息展示 2023-08-06 20:56:59 +08:00
whyour
f947866c32 修复全部任务多语言 2023-08-06 14:55:51 +08:00
whyour
a2e33d1ed4 修复 editor 判断语言 2023-08-05 13:18:28 +08:00
whyour
b1a242c8ee 更新多语言 2023-08-05 12:33:43 +08:00
whyour
0bf28e9ab3 task 支持运行 mjs 文件 2023-08-05 11:02:29 +08:00
whyour
624c9374e5 修复定时任务列表虚拟滚动 2023-08-04 22:24:54 +08:00
whyour
2e27d4057e 定时任务增加关联订阅 2023-07-30 13:38:38 +08:00