controller v0.47.0: backups page — whole-guest backup visibility + manual trigger
Part 2 of the USB/backup spec. agentapi: StatusResponse.Backup record, DueResponse
age_seconds, RestoreTestStatus(). New "Rendszermentés (teljes mentés)" section
(read-only: last backup/target PBS-vs-local/next-due/restore-test) + "Mentés most"
manual trigger that goes through the quiesce loop (controller owns quiescing):
quiesce.Loop gains mutex + TriggerNow() (single-flight, async). New
/api/guest-backup/{trigger,status} (distinct from apiRouter's /api/backup/*).
App-data rows relabeled under an "Alkalmazás-mentések" divider. Config → slice 10.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,11 @@ type Server struct {
|
||||
// App export/import engine (optional)
|
||||
appExporter *appexport.Exporter
|
||||
|
||||
// Whole-guest backup trigger (the quiesce loop; optional — nil on an unprovisioned guest or when
|
||||
// quiesce is disabled). Drives the "Mentés most" button: the CONTROLLER owns quiescing, so the
|
||||
// manual trigger goes through the loop (stop stacks → backup → resume), never a bare agent call.
|
||||
backupTrigger BackupTrigger
|
||||
|
||||
// Debug mode support
|
||||
logBuffer *LogBuffer
|
||||
debugCallbacks *DebugCallbacks
|
||||
@@ -172,6 +177,19 @@ func (s *Server) SetAppExporter(e *appexport.Exporter) {
|
||||
s.appExporter = e
|
||||
}
|
||||
|
||||
// BackupTrigger forces an app-consistent whole-guest backup NOW (the quiesce loop satisfies it).
|
||||
// Returns quiesce.ErrBackupInProgress when a cycle is already running (single-flight).
|
||||
type BackupTrigger interface {
|
||||
TriggerNow() error
|
||||
}
|
||||
|
||||
// SetBackupTrigger wires the whole-guest backup trigger (the quiesce loop) for the "Mentés most"
|
||||
// button. Optional — left nil on an unprovisioned guest or when quiesce is disabled (the button then
|
||||
// renders disabled with an explanatory note).
|
||||
func (s *Server) SetBackupTrigger(t BackupTrigger) {
|
||||
s.backupTrigger = t
|
||||
}
|
||||
|
||||
// SetStartTime records the controller start time for uptime calculation.
|
||||
func (s *Server) SetStartTime(t time.Time) {
|
||||
s.startTime = t
|
||||
|
||||
Reference in New Issue
Block a user