feat: add buttons to update hermes and restart gateway

This commit is contained in:
Austin Pickett 2026-04-21 09:01:23 -04:00
parent ea06104a3c
commit fc21c14206
9 changed files with 492 additions and 70 deletions

View file

@ -183,6 +183,16 @@ export const api = {
);
},
// Gateway / update actions
restartGateway: () =>
fetchJSON<ActionResponse>("/api/gateway/restart", { method: "POST" }),
updateHermes: () =>
fetchJSON<ActionResponse>("/api/hermes/update", { method: "POST" }),
getActionStatus: (name: string, lines = 200) =>
fetchJSON<ActionStatusResponse>(
`/api/actions/${encodeURIComponent(name)}/status?lines=${lines}`,
),
// Dashboard plugins
getPlugins: () =>
fetchJSON<PluginManifestResponse[]>("/api/dashboard/plugins"),
@ -200,6 +210,20 @@ export const api = {
}),
};
export interface ActionResponse {
name: string;
ok: boolean;
pid: number;
}
export interface ActionStatusResponse {
exit_code: number | null;
lines: string[];
name: string;
pid: number | null;
running: boolean;
}
export interface PlatformStatus {
error_code?: string;
error_message?: string;