Implement AC Nautik PDF Export, E2E Encrypted Photos, and Background GPS Route Tracking

This commit is contained in:
2026-05-28 12:19:33 +02:00
parent acaa575b08
commit 9a2052f623
14 changed files with 1539 additions and 49 deletions
+19
View File
@@ -5,6 +5,7 @@ import { getActiveMasterKey } from '../services/auth.js'
import { decryptJson, encryptJson } from '../services/crypto.js'
import { syncLogbook } from '../services/sync.js'
import { downloadCsv, shareCsv } from '../services/csvExport.js'
import { downloadLogbookPagePdf } from '../services/pdfExport.js'
import LogEntryEditor from './LogEntryEditor.tsx'
import { FileText, Plus, Trash2, ChevronRight, Calendar, Download, Share2 } from 'lucide-react'
@@ -110,6 +111,20 @@ export default function LogEntriesList({ logbookId }: LogEntriesListProps) {
}
}
const handleDownloadPdf = async (entryId: string, date: string, e: React.MouseEvent) => {
e.stopPropagation()
setExporting(true)
setError(null)
try {
await downloadLogbookPagePdf(logbookId, entryId, date)
} catch (err: any) {
console.error('Failed to download PDF:', err)
setError(err.message || 'Failed to generate PDF export.')
} finally {
setExporting(false)
}
}
const handleCreate = async () => {
setLoading(true)
setError(null)
@@ -269,6 +284,10 @@ export default function LogEntriesList({ logbookId }: LogEntriesListProps) {
</div>
</div>
<button className="btn-pdf" onClick={(e) => handleDownloadPdf(item.id, item.date, e)} title={t('logs.export_pdf')} disabled={exporting}>
<Download size={18} />
</button>
<button className="btn-delete" onClick={(e) => handleDelete(item.id, e)} title={t('logs.delete_entry')}>
<Trash2 size={18} />
</button>