Skip to content

Admin UI: show gateway status and improve controls #213

@isaacrowntree

Description

@isaacrowntree

Problem

The admin UI's Gateway Controls section only shows a "Restart Gateway" button with static text. There's no indication of whether the gateway is actually running, starting, or stopped.

This makes it hard to diagnose issues — for example, the sync endpoint returns 500 when the gateway isn't running (#207), but the admin UI gives no visual clue that the gateway is down. You have to check logs to understand what's happening.

After clicking "Restart Gateway", there's also no feedback on whether the restart succeeded. The button shows "Restarting..." briefly during the API call, but the restart is fire-and-forget (waitUntil) so the client never learns the outcome.

Proposal

Add a gateway status indicator and improve the controls:

  1. New endpoint GET /api/admin/gateway/status returning process state (running / starting / stopped) using the existing findExistingMoltbotProcess() + a quick port check
  2. Status badge next to "Gateway Controls" header — green "Running" / yellow "Starting" / red "Stopped"
  3. Context-aware button — show "Start Gateway" when stopped, "Restart Gateway" when running
  4. Post-restart polling — after restart, poll status until gateway is ready (or timeout with error)
  5. Disable "Backup Now" when gateway is stopped, since sync requires the gateway (R2 backup never runs: requires active gateway process, creating chicken-and-egg problem #207)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions