Commit Graph
764 Commits
Author SHA1 Message Date
maziggy fe17a6905f Fix AMS auto-matching to use tray_info_idx from 3MF files
When multiple AMS trays have the same filament type and color, Bambuddy
now uses the tray_info_idx attribute from the 3MF file to identify the
exact spool selected during slicing. This ensures the correct tray is
used rather than just picking the first match.

Matching priority: tray_info_idx > exact color > similar color > type-only

Closes #245
2026-02-04 08:18:05 +01:00
maziggy a0d878a231 Fix AMS auto-matching to use tray_info_idx from 3MF files
When multiple AMS trays have the same filament type and color, Bambuddy
now uses the tray_info_idx attribute from the 3MF file to identify the
exact spool selected during slicing. This ensures the correct tray is
used rather than just picking the first match.

Matching priority: tray_info_idx > exact color > similar color > type-only

Closes #245
2026-02-04 08:13:54 +01:00
maziggy f805174e3f Fix mobile layout issues on Archives and Statistics pages
Header action buttons were overflowing outside the screen on iPhone/mobile
devices because the header containers used fixed horizontal layouts.

Changed both pages to use the responsive pattern from PrintersPage:
- Headers stack vertically on mobile (flex-col), horizontal on sm+ (sm:flex-row)
- Button containers use flex-wrap to allow wrapping on narrow screens
- Added gap-4 between title and buttons when stacked

Closes #255
2026-02-04 07:44:58 +01:00
maziggy b3c3ab0563 Fix queue scheduled time displayed in wrong timezone
When editing a queue item, the scheduled time was being displayed in UTC
instead of the user's local timezone. This caused confusion where:
- User selects April 2, 2:00 PM local time
- After saving, it appears shifted by their timezone offset
- Month/day could appear swapped due to the timezone difference

The fix converts the UTC time from the server to local time when
populating the datetime-local input, using toDateTimeLocalValue()
instead of toISOString().slice(0, 16).

Closes #233
2026-02-04 07:35:55 +01:00
maziggy f96b27c5ee Show paused status in print queue when printer is paused
The queue was showing "Printing" even when the printer was paused.
Now fetches real-time printer state for active print jobs and displays
"Paused" with a yellow badge when the printer state is PAUSE/PAUSED.

Changes:
- Add printerState prop to StatusBadge and SortableQueueItem components
- Fetch printer statuses for printers with active jobs using useQueries
- Show pause icon and yellow badge when printing but printer is paused
- Add "paused" translation key for queue status (en, de, ja)

Closes #249
2026-02-04 07:28:46 +01:00
maziggy d4ca646581 Fix filament calculation incorrectly multiplied by quantity
The filament_used_grams field already contains the total filament for
the entire print job (all items combined). The code was incorrectly
multiplying this value by quantity, causing inflated filament totals.

Example: A print with 26 objects using 126g total was being calculated
as 126g * 26 = 3,276g instead of the correct 126g.

Fixes:
- backend/app/api/routes/archives.py: Archive stats endpoint
- backend/app/api/routes/metrics.py: Prometheus metrics endpoint
- frontend/src/components/FilamentTrends.tsx: Trends chart calculations

Closes #229
2026-02-04 07:20:17 +01:00
maziggy 2c8f1e449f Updated README 2026-02-03 17:24:30 +01:00
maziggy b6ce486fba Fix phantom reprint bug in print scheduler
Addresses reports of files being automatically reprinted hours after
the original print completed. The root cause was a race condition where
the queue item status was updated to "printing" AFTER the print command
was sent, allowing stuck "pending" items to be re-triggered on restart.

Changes:
- Set status to "printing" BEFORE sending print command to prevent
  re-triggering if backend crashes after print starts
- Add 24-hour expiration for stale pending queue items
- Add duplicate prevention: skip archives completed within last 4 hours

Trade-off: If backend crashes after status update but before print
command, item will be stuck in "printing" without actually printing.
This is safer than accidentally reprinting and wasting filament.
2026-02-03 17:18:22 +01:00
MartinNYHC 1120debf75 Merge pull request #247 from MisterBeardy/feature/updated_plate_view
Feature/updated plate view
2026-02-03 17:15:42 +01:00
MartinNYHC 685bf84de1 Merge branch '0.1.8b' into feature/updated_plate_view 2026-02-03 17:15:21 +01:00
maziggy f51795ac4f Updated README 2026-02-03 16:44:58 +01:00
maziggy 0f0ddde929 Updated README 2026-02-03 16:39:51 +01:00
MisterBeardy 6f1d1fa06e Updated archive view to work after merging with latest 0.1.8b 2026-02-03 09:57:50 -05:00
MisterBeardy b2cc82480d rebase changes 2026-02-03 09:42:25 -05:00
MisterBeardy be7aff1f91 Plate management updates 2026-02-03 09:29:13 -05:00
maziggy 104b9d4a25 Fix external spool ams_mapping2 slot_id (Issue #213)
The ams_mapping2 format was incorrectly using the tray_id (254/255) as
the slot_id for external spools. The printer expects slot_id to be the
actual slot index (0 for main nozzle, 1 for deputy nozzle), not the
tray_id value.

Before: {"ams_id": 255, "slot_id": 254}  <- invalid slot index
After:  {"ams_id": 255, "slot_id": 0}    <- correct slot index

This caused prints using external spool to fail immediately with error
code 07FF_8007.

Closes #213
2026-02-03 09:29:13 -05:00
maziggy a2571aaf2e Fix filename matching for files with spaces (Issue #218)
Bambu Studio converts spaces to underscores when saving files to the
printer, but MQTT reports the original name with spaces. This caused
FTP downloads to fail with "550 Failed to open file" because we were
searching for "Battery Storage_giesela.gcode.3mf" but the actual file
was "Battery_Storage_giesela.gcode.3mf".

Changes:
- Add underscore variants to direct download path attempts
- Normalize spaces/underscores in fallback directory search
- Apply fix to archive download, cover extraction, and objects reload

Closes #218
2026-02-03 09:29:13 -05:00
maziggy 91a4e2a0f5 Windows Portable Launcher 2026-02-03 14:56:38 +01:00
maziggy 11bb34f87a Bumped version 2026-02-03 14:36:38 +01:00
MartinNYHC 6e069cebf2 Merge pull request #243 from maziggy/0.1.7
Fixed backup permissions
v0.1.7
2026-02-03 14:07:30 +01:00
MartinNYHC 914c3a5c19 Merge branch 'main' into 0.1.7 2026-02-03 14:06:06 +01:00
maziggy 84d2517aa1 Fixed backup permissions 2026-02-03 14:04:36 +01:00
MartinNYHC 7a149254d5 Merge pull request #242 from maziggy/0.1.7
Fix for Information exposure through an exception #72
2026-02-03 13:50:47 +01:00
MartinNYHC 603e3ca62b Merge branch 'main' into 0.1.7 2026-02-03 13:49:18 +01:00
maziggy ababe4e3ed Fix for Information exposure through an exception #72 2026-02-03 13:48:44 +01:00
MartinNYHC 025325d9b0 Merge pull request #241 from maziggy/0.1.7
Fix for Information exposure through an exception #72
2026-02-03 13:38:31 +01:00
MartinNYHC b05f376e70 Merge branch 'main' into 0.1.7 2026-02-03 13:37:00 +01:00
maziggy 691b7e262a Fix for Information exposure through an exception #72 2026-02-03 13:36:22 +01:00
MartinNYHC a9b3dc5cca Merge pull request #240 from maziggy/0.1.7
Updated test_docker.sh
2026-02-03 13:26:38 +01:00
MartinNYHC 2fe6b04e9b Merge branch 'main' into 0.1.7 2026-02-03 13:26:26 +01:00
maziggy 78cbd58d7a Updated test_docker.sh 2026-02-03 13:14:00 +01:00
maziggy 2837455509 Updated test_docker.sh 2026-02-03 13:13:26 +01:00
MartinNYHC 230aac59a6 Merge pull request #239 from maziggy/0.1.7
v0.1.7
2026-02-03 13:04:18 +01:00
maziggy 37b73b8868 Sync 2026-02-03 13:02:36 +01:00
MartinNYHC 6872d77e1d Merge branch 'main' into 0.1.7 2026-02-03 12:59:27 +01:00
maziggy 8b2bdebb3f Sync 2026-02-03 12:42:55 +01:00
maziggy 89b19cbe4f Sync 2026-02-03 12:40:01 +01:00
maziggy e9e49768fe Sync 2026-02-03 12:30:46 +01:00
maziggy 9787400935 Sync 2026-02-03 12:27:36 +01:00
maziggy 626290d401 Sync 2026-02-03 12:09:28 +01:00
maziggy 08f2dffd75 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.
2026-02-03 12:04:02 +01:00
MartinNYHC 794797ea0c Merge pull request #238 from maziggy/0.1.7
v0.1.7
2026-02-03 11:45:19 +01:00
MartinNYHC 7264e5fb40 Merge branch 'main' into 0.1.7 2026-02-03 11:43:37 +01:00
maziggy a0f3b02287 Bumped version 2026-02-03 11:41:31 +01:00
MartinNYHC 8765a29d12 Merge pull request #237 from maziggy/0.1.7b
v0.1.7b
2026-02-03 11:16:52 +01:00
MartinNYHC 83459128e8 Merge branch 'main' into 0.1.7b 2026-02-03 11:14:53 +01:00
maziggy 601f906339 Updated REAME 2026-02-03 11:04:46 +01:00
maziggy 583c374f01 Add Virtual Printer Proxy Mode for remote printing
Introduces a new "Proxy Mode" for the Virtual Printer that enables
remote printing from anywhere in the world without VPN, port forwarding,
or Bambu Cloud dependency.

Bambuddy acts as a TLS relay between a remote slicer (Bambu Studio/
OrcaSlicer) and the local Bambu Lab printer:

  Remote Slicer → Internet → Bambuddy Server → Local Network → Printer

The slicer connects to Bambuddy using the real printer's serial number
and access code. Bambuddy authenticates and relays all FTP (file transfer)
and MQTT (commands/status) traffic with end-to-end TLS encryption.

- No port forwarding required - printer stays safely on local network
- No VPN needed - connect from coffee shops, hotels, work, anywhere
- No Bambu Cloud dependency - fully self-hosted solution
- End-to-end TLS encryption on FTP (port 9990) and MQTT (port 8883)
- Works with Bambu Studio and OrcaSlicer
- Uses real printer credentials for authentication
- Automatic printer selection from connected printers

- Add SlicerProxyManager class for TLS relay (tcp_proxy.py)
  - TLS termination with auto-generated certificates
  - Concurrent FTP and MQTT proxy servers
  - Connection lifecycle management with proper cleanup
- Extend VirtualPrinterManager with proxy mode support
  - New 'proxy' mode alongside archive/review/queue modes
  - Target printer selection and credential management
- Add proxy configuration endpoints to settings API
- Add permission checks for proxy endpoints

- Add Proxy Mode card to Virtual Printer settings
- Target printer dropdown for proxy destination
- Real-time proxy status display (ports, target, running state)
- Full i18n support (English, German)

- Add network architecture diagram
- Add proxy mode section to README
- Add comprehensive guide to wiki
- Add prominent feature section to website

- Backend unit tests for SlicerProxyManager
- Backend unit tests for proxy mode configuration
- Frontend tests for proxy mode UI components

Closes #207 #170
2026-02-03 11:02:13 +01:00
maziggy 158fa88b7a Fix frontend API calls missing auth tokens
Several frontend components were using raw fetch() instead of the API
client, causing 401 Unauthorized errors when authentication is enabled.

Changes:
- SpoolmanSettings: Use api.getSpoolmanSettings/updateSpoolmanSettings
- ProjectsPage: Use api.importProjectFile for ZIP imports
- ProjectDetailPage: Use api.exportProjectZip for exports
- CameraPage/EmbeddedCameraViewer: Use api.getCameraStatus

Added to API client:
- getSpoolmanSettings()
- updateSpoolmanSettings()
- importProjectFile()
- exportProjectZip()
- getCameraStatus()

Added tests for auth token handling in client.test.ts
Fixed VirtualPrinterSettings test expectations to match i18n strings

Closes #231
2026-02-03 10:19:28 +01:00
MartinNYHC 9e44692765 Merge pull request #236 from maziggy/feature/slicer-proxy
Feature/slicer proxy
2026-02-03 10:04:29 +01:00