mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-07 14:41:24 +02:00
Added new download functions to client.ts:
- downloadArchive(id, filename) - for 3MF archive downloads
- downloadSource3mf(archiveId) - for source 3MF downloads
- downloadF3d(archiveId) - for Fusion 360 file downloads
- downloadLibraryFile(id, filename) - for library file downloads
- downloadPrinterFile(printerId, path) - for printer file downloads
- exportBackup() - fixed (already existed, just added auth header)
Updated components to use auth-aware downloads:
- ArchivesPage.tsx - 8 places fixed (F3D, Source 3MF, Archive downloads)
- FileManagerPage.tsx - Library file download fixed
- FileManagerModal.tsx - Printer file download fixed
All fetch-based downloads now include the Authorization: Bearer ${token} header when auth is enabled.
This commit is contained in:
@@ -175,8 +175,10 @@ export function FileManagerModal({ printerId, printerName, onClose }: FileManage
|
||||
const paths = Array.from(selectedFiles);
|
||||
|
||||
if (paths.length === 1) {
|
||||
// Single file - direct download
|
||||
window.open(api.getPrinterFileDownloadUrl(printerId, paths[0]), '_blank');
|
||||
// Single file - direct download with auth
|
||||
api.downloadPrinterFile(printerId, paths[0]).catch((err) => {
|
||||
console.error('Printer file download failed:', err);
|
||||
});
|
||||
setSelectedFiles(new Set());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user