v0.81.0: retire drive-activation banner; add standalone "Kiszolgáló újraindítása" button

In the intermediary-mount model an enrolled drive binds live into the running
guest (no reboot), so the "… meghajtó aktiválásra vár / Újraindítás most" banner
was an obsolete relic — also dead since v0.78 (pendingActivationDrives keyed on
the raw MountPath vs the now-stable sp.Path). Removed the banner block +
activatePendingDrives JS (settings.html), the PendingDrives feed (handlers.go),
and the dead pendingActivationDrives helper + its unused internal/system import.

Renamed handleStorageActivate -> HandleServerReboot (split out a testable
serverReboot core), removed the /api/storage/activate case, and mounted the
handler at the new non-storage route /api/server/reboot (RequireAuth+CsrfProtect).
The agent GuestReboot primitive is reused unchanged.

Added the standalone "Kiszolgáló újraindítása" settings card (sibling to the
controller-only "Vezérlő újraindítása"), reusing the pollRestart() loop.

Test: TestHandleServerReboot_CallsGuestReboot (fake diskAgent asserts GuestReboot
invoked once + 202). diskAgent/mockAgent gained GuestReboot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PsnU2ASocYrvzqE82YDYW
This commit is contained in:
2026-06-23 18:46:31 +02:00
parent 7cce19797e
commit 242b835a19
7 changed files with 104 additions and 69 deletions
+24
View File
@@ -1,5 +1,29 @@
## Changelog
### v0.81.0 — retire the drive-activation banner; add a standalone "Kiszolgáló újraindítása" button (2026-06-23)
- **Removed the obsolete drive-activation banner.** In the intermediary-mount model an enrolled drive
binds **live** into the running guest (agent `disks.go` — no `pct set -mpN`, no slot, no reboot), so
the "… meghajtó aktiválásra vár / Újraindítás most (~30 mp)" banner was a relic of the old per-drive
reboot model. It was also effectively dead since v0.78 (`pendingActivationDrives` keyed `attached` by
the agent's RAW `MountPath` but compared it to the now-STABLE `sp.Path`). Removed: the
`{{if .PendingDrives}}` banner block + `window.activatePendingDrives` JS (`settings.html`), the
`data["PendingDrives"]` feed (`handlers.go`), and the dead `pendingActivationDrives` helper +
its now-unused `internal/system` import (`storage_handlers.go`).
- **Repointed the reboot endpoint to a non-storage route.** Renamed `handleStorageActivate`
`HandleServerReboot` and split out a testable `serverReboot` core (mirrors `runStorageInit`); removed
the `/api/storage/activate` case from `ServeStorageAPI`; mounted the handler at the new
`/api/server/reboot` (same `RequireAuth` + `CsrfProtect`) in `cmd/controller/main.go`. The agent
`GuestReboot` primitive is reused unchanged. (`/api/storage/activate` now returns 404.)
*Note:* the handler is exported (`HandleServerReboot`) because `cmd/controller/main.go` wires it
cross-package — same convention as every other web handler mounted there.
- **Added the standalone "Kiszolgáló újraindítása" settings card.** A deliberate full-server (guest)
restart affordance, a sibling to the existing "Vezérlő újraindítása" controller-only restart.
New `settings-card` + `restartServer()` JS (reuses the existing `pollRestart()` loop) in
`settings.html`; posts to `/api/server/reboot`.
- **Test:** `TestHandleServerReboot_CallsGuestReboot` (`storage_handlers_test.go`) — a fake `diskAgent`
asserts `GuestReboot` is invoked exactly once and the response is 202 `{ok:true, rebooting:true}`.
`diskAgent`/`mockAgent` gained `GuestReboot`. Green gate: `go build ./... && go vet ./... && go test ./...`.
### v0.80.0 — disk card: show + act on the stable path, not the raw host mount (2026-06-23)
- Follow-up to v0.78/0.79. The storage disk card displayed the drive's **raw** host PVE mount
(`/mnt/<name>`) — which doesn't exist inside the guest — instead of the **stable** in-guest path