feat(updates): auto-apply and self-restart on new dashboard versions
Adds POST /api/updates/apply (pull, rebuild, restart) plus an "Update now" button and hourly auto-check in the UI, for checkouts that are safely fast-forwardable. Reintroduces self-restart (previously removed in edc25ca for cross-environment reliability concerns) per explicit user request.
This commit is contained in:
@@ -557,6 +557,23 @@ export const api = {
|
||||
method: "POST",
|
||||
body: JSON.stringify({}),
|
||||
}),
|
||||
/**
|
||||
* POST /api/updates/apply - fast-forward, rebuild, and restart.
|
||||
*
|
||||
* Only acts when the checkout is fast-forwardable (`tracking_canonical`
|
||||
* or `fork_or_diverged_tracking`); a 409 response means it declined
|
||||
* (`applied: false`, `reason` explains why). On success the server
|
||||
* restarts itself right after responding, so the caller should poll
|
||||
* `status()` until it answers again rather than expect the connection
|
||||
* to outlive the call.
|
||||
*
|
||||
* @returns {@link UpdateStatusPayload} with `applied` set.
|
||||
*/
|
||||
apply: () =>
|
||||
request<UpdateStatusPayload>("/updates/apply", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({}),
|
||||
}),
|
||||
},
|
||||
|
||||
// ──────────────────────────────── Stats API ────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user