Skip to content

feat: Quick Actions panel (restart gateway, clear cache, rotate logs, health check)#263

Open
vivekchand wants to merge 1 commit intomainfrom
fix/gh-clawmetry-252-quick-actions
Open

feat: Quick Actions panel (restart gateway, clear cache, rotate logs, health check)#263
vivekchand wants to merge 1 commit intomainfrom
fix/gh-clawmetry-252-quick-actions

Conversation

@vivekchand
Copy link
Owner

Closes #252

What

Adds a new Actions tab to the ClawMetry dashboard with a Quick Actions panel for common operational tasks.

How

Backend (dashboard.py)

  • POST /api/actions/run — executes one of 4 actions with a confirmation gate:
    • restart-gateway: tries openclaw gateway restartsystemctl --user restart openclawsystemctl restart openclaw in order
    • clear-cache: purges ~/.clawmetry/cache, /tmp/clawmetry_cache, and resets the in-process OTEL store
    • rotate-logs: sends SIGUSR1 to openclaw/clawmetry processes + runs logrotate -f if available
    • health-check: gateway ping, disk usage, session count — returns a one-line summary
  • GET /api/actions/history — returns in-memory ring-buffer of last 50 action results
  • Both endpoints registered on the existing bp_health blueprint

Frontend (both dark + light themes)

  • Actions nav tab added to both theme variants
  • page-actions div with a 2-column card grid (icon + description + button per action)
  • Confirmation dialog modal before executing any destructive action (restart, clear, rotate)
  • Result banner (green on success, red on failure) with output and duration_ms
  • Recent Actions table showing last 50 runs

Tests

  • 5 new tests in TestQuickActions: POST-only enforcement, unknown action rejection, health-check, clear-cache, history structure
  • All 81 existing tests pass, 6 skipped (unchanged)

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: Quick Actions panel (restart gateway, clear cache, rotate logs)

1 participant