feat: add Update Hermes and Restart Gateway action buttons to web dashboard
All checks were successful
Lint / lint (pull_request) Successful in 10s
All checks were successful
Lint / lint (pull_request) Successful in 10s
Implements the action button lifecycle described in #961: - POST /api/actions/restart-gateway — sends SIGTERM to the gateway PID - POST /api/actions/update-hermes — runs pip upgrade in a background job - GET /api/actions/jobs/{job_id} — polls job status/output Frontend (StatusPage.tsx): - "Restart Gateway" button with spinning icon while running, then success/error message that clears after 5–8 s - "Update Hermes" button that polls the job endpoint every 2 s; shows collapsible pip output on completion - Page remains responsive (buttons disabled only during their own action) Also adds i18n strings to en.ts, zh.ts, and the shared types.ts interface. Fixes #961 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -426,3 +426,4 @@ export interface OAuthPollResponse {
|
||||
error_message?: string | null;
|
||||
expires_at?: number | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -223,16 +223,13 @@ export default function StatusPage() {
|
||||
<RefreshCw className={`h-3.5 w-3.5 mr-1 ${restartState === "running" ? "animate-spin" : ""}`} />
|
||||
{restartState === "running" ? t.status.restarting : t.status.restartGateway}
|
||||
</Button>
|
||||
{restartDetail && (
|
||||
{(restartDetail || restartState === "success") && (
|
||||
<p className={`text-xs max-w-xs truncate ${restartState === "failure" ? "text-destructive" : "text-muted-foreground"}`}>
|
||||
{restartState === "failure" && <TriangleAlert className="inline h-3 w-3 mr-1" />}
|
||||
{restartState === "success" ? t.status.restartSuccess : restartState === "failure" ? t.status.restartFailed : ""}
|
||||
{restartDetail && ` — ${restartDetail}`}
|
||||
</p>
|
||||
)}
|
||||
{restartState === "success" && !restartDetail && (
|
||||
<p className="text-xs text-muted-foreground">{t.status.restartSuccess}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Update Hermes */}
|
||||
|
||||
Reference in New Issue
Block a user