feat: auto-save 5min + backup 30min + backup management UI

- project_backups table + DB migration
- Backup CRUD API endpoints with auto cleanup (5-20 retention)
- setInterval 5min save + 30min backup in browser
- ProfileModal: backup list, delete, retention slider, cleanup button
This commit is contained in:
2026-07-30 20:48:45 +07:00
parent 58a294d845
commit 9c487614f1
4 changed files with 180 additions and 19 deletions
+5
View File
@@ -71,6 +71,11 @@ window.API_BASE_URL = window.API_BASE_URL || window.location.origin;
saveAIPreset: (preset) => apiRequest('/api/v1/ai/presets', { method: 'POST', body: JSON.stringify(preset) }),
deleteAIPreset: (presetId) => apiRequest(`/api/v1/ai/presets/${presetId}`, { method: 'DELETE' }),
createBackup: (projectId) => apiRequest(`/api/v1/projects/cloud/${projectId}/backup`, { method: 'POST' }),
listBackups: (projectId) => apiRequest(`/api/v1/projects/cloud/${projectId}/backups`, { method: 'GET' }),
deleteBackup: (backupId) => apiRequest(`/api/v1/projects/cloud/backups/${backupId}`, { method: 'DELETE' }),
cleanupBackups: (keep) => apiRequest('/api/v1/projects/cloud/backups/cleanup', { method: 'POST', body: JSON.stringify({ keep }) }),
renderProject: (projectJson, outputFilename) => apiRequest('/api/v1/plugins/render', { method: 'POST', body: JSON.stringify({ project_json: projectJson, output_filename: outputFilename }) }),
deleteSoundFont: (sfId) => apiRequest(`/api/v1/plugins/soundfont/${sfId}`, { method: 'DELETE' }),
uploadSoundFont: async (file) => {