Skip to content

feat: Cron management UI (GH #253)#257

Open
vivekchand wants to merge 1 commit intomainfrom
feat/cron-management-ui-253
Open

feat: Cron management UI (GH #253)#257
vivekchand wants to merge 1 commit intomainfrom
feat/cron-management-ui-253

Conversation

@vivekchand
Copy link
Owner

Summary

Full cron job management UI in the ClawMetry dashboard. Closes #253.

What changed

Cron list with full CRUD

  • Run Now button fires the job on demand (confirmation dialog already present)
  • Enable/Disable toggle per job with instant optimistic UI update
  • Edit button opens the existing edit modal to modify schedule, prompt, channel, model
  • Delete button with confirmation dialog
  • New Job button to create cron jobs without leaving the dashboard
  • All buttons were previously commented out; this PR enables them now that gateway CRUD has been validated

Auto-refresh

  • Polls /api/crons every 30s automatically when the Crons tab is active
  • Checkbox toggle to pause/resume auto-refresh
  • Timer is cleaned up when switching to another tab (no background polling)

Human-readable schedule descriptions

  • Cron expressions now show a plain-English label alongside the raw expression
  • Examples: '*/30 * * * *' shows 'every 30 minutes', '0 9 * * 1-5' shows 'weekdays at 09:00', '0 * * * *' shows 'every hour at :00'
  • 'every Xmin' intervals show 'every Xh' when >= 60 minutes

Multi-node cron status panel

  • Appears above the job list when fleet nodes are registered via /api/nodes
  • Per-node card shows: online/offline indicator, node name, job count, error count, last run time
  • Hidden automatically when no nodes are in the fleet
  • Pulls cron summary from node latest_metrics.crons field

Execution history

  • Already implemented (expandable rows with calendar heatmap, run log modal)
  • No changes needed; works with the existing /api/cron/{id}/runs endpoint

Testing

  • Python syntax validated: python3 -m py_compile dashboard.py
  • No regressions: all existing cron JS functions (cronRunNow, cronToggle, cronEdit, cronDelete, cronCreateNew, loadCronRuns, loadCronLog) are unchanged in logic; only the commented-out lines are uncommented

…253)

- Enable Run Now, Toggle, Edit, Delete buttons (previously disabled pending gateway testing)
- Add New Job button to create cron jobs from the dashboard
- Add auto-refresh every 30s with checkbox toggle (pauses when leaving Crons tab)
- Add human-readable schedule descriptions alongside cron expressions
  - Examples: '*/30 * * * *' shows 'every 30 minutes', '0 9 * * 1-5' shows 'weekdays at 09:00'
- Add multi-node cron status panel for fleet deployments
  - Shows per-node online/offline status, job count, error count, last run time
  - Hidden when no fleet nodes are registered
- Execution history with calendar heatmap already in place (expandable rows)
- Stop auto-refresh timer when switching away from Crons tab to avoid background polling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Cron management UI (view, toggle, trigger jobs from dashboard)

1 participant