v2: backups management page in settings#1109
Merged
Merged
Conversation
Adds a "Backups" section to the v2 settings modal so admins can manage PostgreSQL dumps without dropping back to the v1 admin UI: - list + at-a-glance stats (count, total size, schedule, retention, database, backup directory, preflight status) - create on-demand backup - restore from an existing backup (with confirmation) - restore from an uploaded .sql.gz (with confirmation) - delete a backup - download a backup - edit the automatic schedule + retention window The SPA talks to a new admin-only /web/v1/backups/* surface that wraps the existing internal/service.BackupService. The v1 admin handlers at /-/backups/* are untouched. All shadcn primitives are used as-is; no new UI components introduced. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d17c6ce to
f2d30cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Backups section to the v2 settings modal so admins can manage PostgreSQL dumps from the new dashboard. Previously the only way to manage backups was the v1 admin UI at
/settings/backups.The page wraps the existing
internal/service.BackupServicevia a new admin-only/web/v1/backups/*surface:GET/web/v1/backupsPOST/web/v1/backupsDELETE/web/v1/backups/{filename}GET/web/v1/backups/{filename}/download.sql.gzto the browserPOST/web/v1/backups/{filename}/restoreAlertDialogconfirm)POST/web/v1/backups/restore.sql.gz(multipart, capped at 500 MB)PUT/web/v1/backups/scheduleAll routes are session-only and admin-only (
admin.IsAdmingate — editor/viewer get 403). The v1 admin handlers at/-/backups/*are unchanged; both UIs coexist.The SPA side is one new
BackupsSectionfeature component built on existing shadcn primitives (Alert,AlertDialog,Badge,Button,Form,Input,Select,Separator,Skeleton,Tooltip). No new components added tocomponents/uiorcomponents/.Validation
Tested live against a worktree server with a real PostgreSQL backup created end-to-end (create → list → schedule → confirmations all wired). Desktop and mobile both render cleanly.
Desktop — initial view (1280×1100, dialog clipped to its 600 px max):
Desktop — full content (dialog auto-height so the file list and schedule form are visible):
Mobile (390×844, sheet scrolled to the Backups heading):
Test plan
GET /web/v1/backupsreturns status + list with stored filesPOST /web/v1/backupsproduces a new.sql.gzand the row appears in the listDELETE /web/v1/backups/{filename}removes itbackup_schedule+backup_retention_days(visible inapp_config).sql.gz; other file types are rejected withINVALID_FILE/web/v1/backups/*route receive403 FORBIDDEN