mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-19 15:54:27 +02:00
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:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user