feat: backup management page + max backups config + auto-cleanup
- Config: max_backups_per_file (default 10) in config.json + UI field - Auto-cleanup: _backup_file deletes oldest backups when limit exceeded - New endpoints: GET /api/backups (list all), POST /api/backups/delete, POST /api/backups/purge (by file or vault) - New module: backup-manager.js - full-page view with filter, grouped by vault/file, individual delete, per-file purge, stats - Link from backup viewer footer: 'Gerer tous les backups'
This commit is contained in:
@@ -213,6 +213,7 @@ function renderMainView() {
|
||||
|
||||
'<div class="backup-footer">' +
|
||||
'<span class="backup-footer-hint">Backups crees lors de la sauvegarde manuelle (Ctrl+S)</span>' +
|
||||
'<button class="backup-footer-manage-btn" id="backup-manage-btn">Gerer tous les backups</button>' +
|
||||
'</div>';
|
||||
|
||||
setBody(html);
|
||||
@@ -249,6 +250,14 @@ function bindEvents() {
|
||||
}
|
||||
|
||||
var modeBtn = document.getElementById('backup-diff-mode-btn');
|
||||
var manageBtn = document.getElementById('backup-manage-btn');
|
||||
if (manageBtn) {
|
||||
manageBtn.addEventListener('click', function() {
|
||||
close();
|
||||
import('./backup-manager.js').then(function(m) { m.openBackupManager(); });
|
||||
});
|
||||
}
|
||||
|
||||
if (modeBtn) {
|
||||
modeBtn.addEventListener('click', function() {
|
||||
state.diffMode = state.diffMode === 'sidebyside' ? 'unified' : 'sidebyside';
|
||||
|
||||
Reference in New Issue
Block a user