feat: add database export and import functionality with user confirmation

This commit is contained in:
Felix Schlusche
2025-10-24 15:23:10 +02:00
parent 1cc8dc3b6c
commit 73b83198cb
2 changed files with 145 additions and 0 deletions

View File

@@ -509,6 +509,29 @@
class="w-full px-4 py-2 border border-gray-600 bg-gray-700 text-gray-100 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
</div>
</div>
<!-- Database Export/Import -->
<div class="mt-6 pt-4 border-t border-gray-600">
<h3 class="text-sm font-semibold text-gray-300 mb-3 flex items-center gap-2">
<i data-lucide="database" class="w-4 h-4 text-purple-400"></i>
Datenbank Verwaltung
</h3>
<div class="flex flex-wrap gap-3">
<button id="btnExportDB" class="flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors">
<i data-lucide="download" class="w-4 h-4"></i>
Datenbank exportieren
</button>
<button id="btnImportDB" class="flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg transition-colors">
<i data-lucide="upload" class="w-4 h-4"></i>
Datenbank importieren
</button>
<input type="file" id="importDBFile" accept=".json" class="hidden">
</div>
<p class="text-xs text-gray-500 mt-2">
<i data-lucide="info" class="w-3 h-3 inline"></i>
Export erstellt eine JSON-Datei mit allen Einträgen und Einstellungen. Import überschreibt alle vorhandenen Daten.
</p>
</div>
</details>
</div>