Add Fusion 360 (.f3d) design file attachments to archives

- Add f3d_path field to PrintArchive model and ArchiveResponse schema
- Add API endpoints for F3D upload/download/delete
- Add cyan badge on archive cards when F3D file is attached
- Add context menu options: Upload/Replace F3D, Download F3D, Remove F3D
- Include F3D files in backup/restore
- Add database migration for f3d_path column
- Add API tests for F3D endpoints
- Rebuild CHANGELOG from GitHub releases

Resolves #90
This commit is contained in:
maziggy
2026-01-19 13:29:37 +01:00
committed by MartinNYHC
parent 5d6ba0f875
commit 0b2c0c214d
12 changed files with 625 additions and 714 deletions
+21
View File
@@ -202,6 +202,7 @@ export interface Archive {
thumbnail_path: string | null;
timelapse_path: string | null;
source_3mf_path: string | null;
f3d_path: string | null;
duplicates: ArchiveDuplicate[] | null;
duplicate_count: number;
object_count: number | null;
@@ -1682,6 +1683,26 @@ export const api = {
request<{ status: string }>(`/archives/${archiveId}/source`, {
method: 'DELETE',
}),
// F3D (Fusion 360 design file)
getF3dDownloadUrl: (archiveId: number) =>
`${API_BASE}/archives/${archiveId}/f3d`,
uploadF3d: async (archiveId: number, file: File): Promise<{ status: string; filename: string }> => {
const formData = new FormData();
formData.append('file', file);
const response = await fetch(`${API_BASE}/archives/${archiveId}/f3d`, {
method: 'POST',
body: formData,
});
if (!response.ok) {
const error = await response.json().catch(() => ({}));
throw new Error(error.detail || `HTTP ${response.status}`);
}
return response.json();
},
deleteF3d: (archiveId: number) =>
request<{ status: string }>(`/archives/${archiveId}/f3d`, {
method: 'DELETE',
}),
// QR Code
getArchiveQRCodeUrl: (archiveId: number, size = 200) =>