Feat/cron UI#114
Open
smileoniks-ctrl wants to merge 6 commits into
Open
Conversation
Add a remote cron management surface for saved non-virtual nodes. The node management card now links to a dedicated /panel/nodes/:id/cron page with cron user selection, service status controls, task/raw crontab modes, task add/edit/delete/run-now actions, diff confirmation before saving, conflict messaging, and backup path feedback. Implement the panel route layer and remote cron service behind the existing panel auth/onboarding middleware. The service reads and writes per-user crontabs over existing SSH access, requires baseHash conflict protection, creates restrictive backup/temp files, validates cron users/content, executes Run Now as the selected cron user, sanitizes JSON errors, and rate-limits write/execute/service endpoints. Cover the contract with three standalone Node tests under scripts/: - test-remote-cron-service.js asserts cron validation, hash conflicts, restrictive backup/temp handling, safe command construction, selected-user Run Now behavior, output truncation, and cron service fallbacks. - test-node-cron-panel.js asserts route mounting, node/SSH/user validation, save/run/service JSON behavior, sanitized failures, 409 conflicts, and no cron content or command leakage in logs. - test-node-cron-ui.js asserts the management link, node-cron UI contract, diff confirmation flow, selected-user Run Now payload, unsafe innerHTML avoidance, locale keys, and npm test wiring. Wire all three scripts into the npm test chain so the cron management contract is enforced on every run.
Replace the plain-text 400 ('SSH credentials are required...') on
GET /panel/nodes/:id/cron with an onboarding-style empty state
matching the setup/wizard start page. The page now renders
views/cron-empty.ejs with a reason of 'virtual' (no remote host)
or 'no-ssh' (missing credentials), a 3-step SSH setup guide for
the latter, and two action buttons ('Back to node', 'Back to list').
The JSON API endpoints (/cron/data, /cron/save, /cron/run,
/cron/service) keep their 400 JSON responses for clients.
i18n: 9 new keys in nodes.* (en, ru, zh-CN).
Serialize remote cron saves per node and user to avoid lost updates, clean temporary files on failure, and surface run-now errors in the UI. Add regression coverage for JSON route rejection, POST user validation, backup failures, temp cleanup, and concurrent saves.
Add a dedicated broadcast panel route that lists SSH-capable nodes and deduplicates physical hosts by IP. Implement multicast cron block application over SSH, including managed C³ markers, per-node result summaries, optional immediate execution, and validation for cron users and content. Extend the broadcast terminal UI with Terminal and Multicast Cron tabs, cron form controls, localized labels, and result rendering. Wire the nodes page to the new broadcast route and cover the service, panel route, and UI behavior with standalone Node tests.
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.
What changed
• Added remote cron management for saved non-virtual nodes, including a dedicated node cron page, cron user selection, task/raw crontab modes, diff confirmation,
conflict handling, run-now actions, service controls, and backup feedback.
• Hardened remote cron writes by serializing saves per node/user, validating users and cron content, cleaning temporary files on failure, sanitizing JSON errors, and
surfacing run-now failures in the UI.
• Added an onboarding-style empty state for nodes that cannot use remote cron, including virtual nodes and nodes without SSH credentials.
• Added a beta badge to the node cron action in the management UI.
• Added multicast cron support in the broadcast terminal, including a dedicated broadcast route, Terminal / Multicast Cron tabs, managed C³ cron blocks, optional
immediate execution, per-node result summaries, and localized labels.
Why
This gives operators a safer and more complete cron management workflow for both individual nodes and multi-node broadcast operations, while keeping invalid or
unsupported node states understandable in the panel UI.