Commit Graph

2011 Commits

Author SHA1 Message Date
whyour
236dad75e6 support flowgram 2025-11-24 01:49:59 +08:00
copilot-swe-agent[bot]
d22803ea66 Fix: Correct import name from NODE_TYPES to WorkflowNodeType
Fixed build error:
- Changed import from NODE_TYPES to WorkflowNodeType (actual export name)
- Matches the enum exported from nodes/constants.ts
- Resolves "No matching export" build error

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 13:45:39 +00:00
copilot-swe-agent[bot]
eccda4da1a Fix: Refactor tools plugin following Flowgram demo patterns
Comprehensive fixes based on feedback:
1. Fixed zoom: use playgroundTools.zoom for reading, playgroundTools.config.updateZoom for setting
2. Created useAddNode hook following Flowgram pattern for proper node addition
3. Added Minimap component to DemoTools (removed from useEditorProps plugin)
4. Fixed createHistoryNodePlugin to accept opts parameter
5. Updated createPanelManagerPlugin to create custom tools panel
6. Created NodePanel component following Flowgram demo pattern
7. Updated createFreeNodePanelPlugin with renderer parameter
8. All components now follow official Flowgram.ai patterns exactly

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 13:40:08 +00:00
copilot-swe-agent[bot]
a1b21e81f6 Add custom tools plugin following Flowgram demo pattern
Created DemoTools plugin with comprehensive toolbar:
- Plugin structure following @flowgram.ai/panel-manager-plugin pattern
- Positioned at top-center matching Flowgram demo screenshot
- Integrated with Flowgram's history, playground, and viewport APIs
- Tools include: fit view, grid view, zoom controls, lock/unlock, comments
- Undo/Redo with real-time state management
- Add Node dropdown with all node types
- Test Run button (green)
- Added 13 new translation keys (zh-CN + en-US)
- Removed old bottom-left tools component
- Plugin automatically renders via layer system

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 11:06:14 +00:00
copilot-swe-agent[bot]
54e2468c7a Refactor: Replace custom toolbar with Flowgram-style tools component
Following Flowgram demo structure:
- Created tools component directory with index, styles, zoom-select, add-node-dropdown
- Implemented FloatingTools positioned at bottom-left (like Flowgram demo)
- Added undo/redo buttons with history integration
- Added zoom selector dropdown (50%, 100%, 150%, 200%)
- Added fit-view button for canvas fitting
- Added Add Node dropdown with all node types
- Updated FlowgramEditor to use new tools component
- Removed old toolbar from editor
- Added 6 new translation keys (zh-CN + en-US)
- Following exact Flowgram UI patterns with styled-components

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 10:57:29 +00:00
copilot-swe-agent[bot]
b356069e6c Add DockedPanelLayer to workflow editor for panel management
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 10:48:13 +00:00
copilot-swe-agent[bot]
47e887cf83 Fix: Add toolbar and fix minimap positioning in workflow editor
- Added toolbar with node creation buttons (HTTP, Script, Condition, Delay, Loop)
- Added zoom controls (Zoom In, Zoom Out, Fit to Canvas)
- Fixed minimap positioning to stay within modal bounds
- Updated CSS to ensure proper containment
- Added 9 new translation keys for toolbar (zh-CN and en-US)

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 10:42:59 +00:00
whyour
81f6f84891 fix scenario style 2025-11-23 18:37:29 +08:00
copilot-swe-agent[bot]
a691951f6d Fix: Update plugin configuration - add history plugin and configure minimap size
- Changed plugins to function returning array
- Added createHistoryNodePlugin for undo/redo support
- Configured minimap with smaller size (150x100px)
- Updated createPanelManagerPlugin with factories and layerProps
- All plugin creation functions now receive proper parameters

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 10:18:38 +00:00
copilot-swe-agent[bot]
829727ad33 Changes before error encountered
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 06:17:47 +00:00
copilot-swe-agent[bot]
e1b903b6db Fix: Add ScenarioModel sync to database loader and migration for status column
- Import and sync ScenarioModel in back/loaders/db.ts
- Add migration to ensure 'status' column exists in Scenarios table
- Fixes SQLITE_ERROR: table Scenarios has no column named status

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 06:12:21 +00:00
copilot-swe-agent[bot]
95780bd3ad Add Flowgram integration documentation
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 06:06:17 +00:00
copilot-swe-agent[bot]
a0a70703bc Refactor workflow editor to use Flowgram.ai library
- Installed @flowgram.ai packages (free-layout-editor and plugins)
- Created node registries following Flowgram pattern
- Implemented FlowgramEditor component with proper integration
- Simplified workflowEditorModal to use Flowgram
- Added necessary translations
- All builds succeed

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 06:05:24 +00:00
copilot-swe-agent[bot]
99829240d3 Add comprehensive implementation summary with testing results
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 05:47:55 +00:00
copilot-swe-agent[bot]
f026242ff2 Add comprehensive architecture documentation
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 05:45:56 +00:00
copilot-swe-agent[bot]
e6b36b0a1b Final i18n fixes: Use consistent translation approach for all user messages
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 05:44:11 +00:00
copilot-swe-agent[bot]
46feac1765 Fix i18n: Replace hardcoded strings with internationalized translations
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 05:38:13 +00:00
copilot-swe-agent[bot]
af88062219 Add Scenario Mode with workflow editor - backend and frontend implementation
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 05:32:56 +00:00
copilot-swe-agent[bot]
a4712f2b96 Initial plan 2025-11-23 05:22:31 +00:00
whyour
3b0f55caf4 修复任务实例默认值 2025-11-23 12:45:02 +08:00
Copilot
6a3dd4f83c
Fix null log_name issue by omitting it from shell command when not set (#2849)
* Initial plan

* Fix null log_name handling in runSingle method

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

* Update cron.log_name before makeCommand to avoid passing null to shell

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

* Fix: Only pass log_name to shell when it has a value

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

* Fix uniqPath calculation in runSingle for null log_name

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

* Improve comment clarity in makeCommand

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

* Refactor: Move no_tee and ID to initial commandVariable declaration

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

* Refactor: Simplify uniqPath ternary expression

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-22 12:06:01 +08:00
whyour
177cd3de81 更新 docker 日志 2025-11-22 01:05:28 +08:00
Copilot
d473c3ae88
Fix SSH global private key matching before subscription-specific keys (#2845)
* Initial plan

* Fix SSH global private key loading order by using zzz_ prefix

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

* Use tilde (~) prefix for global SSH config to ensure it loads last

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-21 01:53:58 +08:00
Copilot
ee2fbe5335
Add global SSH key configuration in system settings (#2840)
* Initial plan

* Add backend support for global SSH keys

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

* Add frontend UI for global SSH keys management

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

* Add SshKeyModel to database initialization

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

* Add SSH config generation for global SSH keys

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

* Add internationalization support for SSH key management UI

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

* Simplify to single global SSH key in system settings

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-20 10:09:01 +08:00
Copilot
48abf44ceb
feat: Support multiple concurrent login sessions per platform (#2816)
* Initial plan

* Implement multi-device login support - allow multiple concurrent sessions

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

* Address code review feedback - extract constants and utility functions

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

* Add validation and logging improvements based on code review

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

* Revert unnecessary file changes - keep only multi-device login feature files

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:18:29 +08:00
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
0e5de4a824 更新启动日志 2025-11-16 21:31:52 +08:00
whyour
af96bd98ac 修复系统提示 2025-11-16 21:26:14 +08:00
Copilot
08ef509e27
Optimize log file writes using stream pooling (#2835)
* Initial plan

* Implement LogStreamManager for optimized log writing

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

* Fix error handler in LogStreamManager to avoid race conditions

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-16 21:11:10 +08:00
Copilot
fbeb4f4a6c
Fix PM2 startup failures on ARM routers with Node.js incompatibility (#2828)
* Initial plan

* Add fallback mechanism for PM2 startup failures on incompatible hardware

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-16 20:29:32 +08:00
Copilot
eb09a417a1
Fix DNS resolution failures in Alpine containers by setting ndots:0 (#2827)
* Initial plan

* Fix DNS resolution issue in Alpine containers by adding ndots:0 option

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-16 20:28:12 +08:00
Copilot
e84ddb6cfc
Fix environment variable copy reliability by validating clipboard operation (#2833)
* Initial plan

* Fix env variable copy issue by using onCopy callback

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-16 18:23:45 +08:00
whyour
d01ec3b310 修复 parse cron 2025-11-15 19:09:07 +08:00
whyour
45fac29804 移除用户判断 2025-11-15 17:02:00 +08:00
whyour
72d4c8bfd4 修复 homedir 权限 2025-11-15 02:27:27 +08:00
Copilot
8f23c61fee
Add non-root Docker user support with automatic command setup (#2830)
* Initial plan

* Add non-root user guide and improve error messages

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

* Add PM2_HOME configuration to fix non-root user permission errors

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

* Fix PM2 socket error by using /tmp for PM2_HOME instead of mounted volume

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

* Document symlink permission limitation for non-root users

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

* Clarify that scheduled tasks auto-adapt to use full paths when symlinks unavailable

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

* Add error handling for symlink creation to prevent worker crashes

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

* Add practical solutions for non-root users to use ql and task commands

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

* Modify linkCommand to create symlinks in ~/bin for non-root users

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

* 修复链接 task 命令

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <imwhyour@gmail.com>
2025-11-15 01:46:24 +08:00
whyour
e41eed81ae 移除说明文档 2025-11-14 23:23:01 +08:00
Copilot
58f5fe763f
Add cron task management to QLAPI (#2826)
* Initial plan

* Add cron management capabilities to QLAPI

- Added GetCrons, GetCronById, EnableCrons, DisableCrons, RunCrons to proto
- Implemented gRPC handlers for new cron operations
- Updated client.js to expose new methods to scripts
- Updated sample to demonstrate new API usage

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

* Add documentation for QLAPI cron management features

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

* Specify pnpm version 8.3.1 in package.json

Add packageManager field to enforce pnpm@8.3.1 as requested

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

* Revert pnpm-lock.yaml to original state

The lockfile was inadvertently updated during dependency installation
for proto generation. Reverting to maintain consistency with pnpm@8.3.1.

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

* Regenerate proto files with correct tool versions

Regenerated using protoc v3.17.3 and protoc-gen-ts_proto v2.6.1
to match the original project configuration.

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-14 23:20:56 +08:00
Copilot
214241797d
Fix QlPort and QlGrpcPort environment variables ignored in host network mode and pm2 reload (#2825)
* Initial plan

* Fix host mode port configuration by using QlPort environment variable

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

* Fix GRPC_PORT conflict in host network mode

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

* Ensure BACK_PORT and GRPC_PORT survive pm2 reload with --update-env

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

* Move env.sh sourcing after fix_config to preserve more environment variables

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

* Refactor: Extract export_ql_envs function and move env.sh sourcing earlier

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

* Extract load_ql_envs function and reorder initialization in docker-entrypoint.sh and update.sh

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-14 22:56:39 +08:00
whyour
aedd48c9c4 修改错误日志 2025-11-14 22:23:30 +08:00
Copilot
90ddf0fb57
Fix race condition preventing scheduled tasks from executing in clustered mode (#2819)
* Initial plan

* Fix race condition causing scheduled tasks not to run

Added synchronization to ensure gRPC worker is ready before HTTP worker starts. This prevents the race condition where autosave_crontab() tries to register cron jobs before the gRPC server is ready to accept them.

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

* Add timeout protection for gRPC worker initialization

Added 30-second timeout to prevent system hang if gRPC worker fails to start. This provides better error handling and prevents indefinite waiting.

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

* Refactor worker ready logic and improve restart handling

- Extracted waitForWorkerReady() method for better code reusability
- Improved worker restart logic to wait for gRPC worker readiness
- This addresses code review feedback for better maintainability

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

* Improve logging accuracy for worker restarts

- Fixed log messages to accurately reflect worker state
- Added proper logging after gRPC worker is confirmed ready
- Improved HTTP worker restart logging with PID
- Addresses code review feedback for better clarity

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

* Revert unnecessary pnpm-lock.yaml changes

The pnpm-lock.yaml was unintentionally updated when installing dependencies for testing. No package dependencies were actually changed - only existing code was modified in back/app.ts. Reverting to original state.

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

* Re-register cron jobs when gRPC worker restarts

When the gRPC worker restarts, the scheduled tasks need to be re-added to the new gRPC server instance. This fix:

1. Tracks the HTTP worker reference in the master process
2. Sends a 'reregister-crons' message to the HTTP worker after gRPC restarts
3. HTTP worker calls autosave_crontab() to re-register all cron jobs with the new gRPC server

This ensures scheduled tasks continue to work after a gRPC worker restart.

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-12 00:59:22 +08:00
whyour
c9fc9b4b45 定时任务支持订阅筛选 2025-11-11 01:24:28 +08:00
whyour
8fdc69421c 修改定时任务支持的排序顺序 2025-11-11 01:02:36 +08:00
whyour
1deb264913 升级 cron-parser 2025-11-11 00:37:03 +08:00
Copilot
1f2fd8ac02
Fix URIError from malformed cookies causing white screen on load (#2811)
* Initial plan

* Fix decodeURIComponent error in cookie parsing by adding try-catch

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

* Add type annotation and logging to catch block per code review

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

* Fix TypeScript errors in deps.ts - remove unused path parameter

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

* Revert pnpm-lock.yaml to avoid unnecessary lockfile version upgrade

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 21:53:06 +08:00
whyour
06aa07329f 修复日志目录逻辑 2025-11-09 21:42:45 +08:00
Copilot
4cb9f57479
环境变量支持置顶 (#2822)
* Initial plan

* Add pin to top feature for environment variables

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

* Format code with prettier

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

* Add database migration for isPinned column in Envs table

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

* Use snake_case naming (is_pinned) for database column

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>
Co-authored-by: whyour <imwhyour@gmail.com>
2025-11-09 19:43:33 +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
0e28e1b6c4 修复 pm2 日志目录 2025-11-09 17:52:38 +08:00
whyour
73f8f3c5fa 增加 agent
Create a new agent configuration file for QL agent.
2025-11-08 00:05:56 +08:00