Skip to content

Commit ae8b105

Browse files
author
Admin9705
committed
backup-restore
1 parent 4ecf4f8 commit ae8b105

File tree

9 files changed

+2002
-4
lines changed

9 files changed

+2002
-4
lines changed

frontend/static/js/backup-restore.js

Lines changed: 606 additions & 0 deletions
Large diffs are not rendered by default.

frontend/static/js/new-main.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ let huntarrUI = {
8686

8787
// Check which sidebar should be shown based on current section
8888
console.log(`[huntarrUI] Initialization - current section: ${this.currentSection}`);
89-
if (this.currentSection === 'settings' || this.currentSection === 'scheduling' || this.currentSection === 'notifications' || this.currentSection === 'user') {
89+
if (this.currentSection === 'settings' || this.currentSection === 'scheduling' || this.currentSection === 'notifications' || this.currentSection === 'backup-restore' || this.currentSection === 'user') {
9090
console.log('[huntarrUI] Initialization - showing settings sidebar');
9191
this.showSettingsSidebar();
9292
} else if (this.currentSection === 'requestarr' || this.currentSection === 'requestarr-history') {
@@ -781,6 +781,21 @@ let huntarrUI = {
781781

782782
// Initialize notifications settings if not already done
783783
this.initializeNotifications();
784+
} else if (section === 'backup-restore' && document.getElementById('backupRestoreSection')) {
785+
document.getElementById('backupRestoreSection').classList.add('active');
786+
document.getElementById('backupRestoreSection').style.display = 'block';
787+
if (document.getElementById('settingsBackupRestoreNav')) document.getElementById('settingsBackupRestoreNav').classList.add('active');
788+
newTitle = 'Backup / Restore';
789+
this.currentSection = 'backup-restore';
790+
791+
// Switch to Settings sidebar for backup/restore
792+
this.showSettingsSidebar();
793+
794+
// Set localStorage to maintain Settings sidebar preference
795+
localStorage.setItem('huntarr-settings-sidebar', 'true');
796+
797+
// Initialize backup/restore functionality if not already done
798+
this.initializeBackupRestore();
784799
} else if (section === 'prowlarr' && document.getElementById('prowlarrSection')) {
785800
document.getElementById('prowlarrSection').classList.add('active');
786801
document.getElementById('prowlarrSection').style.display = 'block';
@@ -5005,6 +5020,17 @@ let huntarrUI = {
50055020
});
50065021
},
50075022

5023+
initializeBackupRestore: function() {
5024+
console.log('[huntarrUI] initializeBackupRestore called');
5025+
5026+
// Initialize backup/restore functionality
5027+
if (typeof BackupRestore !== 'undefined') {
5028+
BackupRestore.initialize();
5029+
} else {
5030+
console.error('[huntarrUI] BackupRestore module not loaded');
5031+
}
5032+
},
5033+
50085034
initializeProwlarr: function() {
50095035
console.log('[huntarrUI] initializeProwlarr called');
50105036

0 commit comments

Comments
 (0)