mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 05:05:38 -04:00
Add configurable backup schedule with admin UI
- Make backup frequency (6h/12h/1d/7d), time, and day-of-week configurable via settings, stored in appSettings key-value table - Add rescheduleBackup() to dynamically update cron job at runtime - Differentiate manual (sofa-manual-*) vs scheduled (sofa-scheduled-*) backup filenames with source icons and tooltips in the backup list - Pruning now only targets scheduled backups, leaving manual ones intact - Merge backup-actions.ts into actions.ts, use shadcn DropdownMenu for all selectors (consistent with dashboard stats cards) - Fix hydration mismatch on relative backup timestamps Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,15 @@ export default async function SettingsPage() {
|
||||
const maxBackupRetention = isAdmin
|
||||
? Number.parseInt(getSetting("maxBackupRetention") ?? "7", 10)
|
||||
: 7;
|
||||
const backupFrequency = isAdmin
|
||||
? (getSetting("backupScheduleFrequency") ?? "1d")
|
||||
: "1d";
|
||||
const backupTime = isAdmin
|
||||
? (getSetting("backupScheduleTime") ?? "02:00")
|
||||
: "02:00";
|
||||
const backupDow = isAdmin
|
||||
? Number.parseInt(getSetting("backupScheduleDow") ?? "0", 10)
|
||||
: 0;
|
||||
|
||||
const repoUrl = "https://github.com/jakejarvis/sofa";
|
||||
|
||||
@@ -129,6 +138,9 @@ export default async function SettingsPage() {
|
||||
initialBackups={backups}
|
||||
initialScheduledEnabled={scheduledBackupsEnabled}
|
||||
initialMaxRetention={maxBackupRetention}
|
||||
initialFrequency={backupFrequency as "6h" | "12h" | "1d" | "7d"}
|
||||
initialTime={backupTime}
|
||||
initialDow={backupDow}
|
||||
/>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user