Commit Graph
333 Commits
Author SHA1 Message Date
maziggy 30fba33dcf Fix sidebar link custom icons displaying with inverted colors (#308)
CSS invert() filter was applied to all custom uploaded icons in dark
mode, causing full-color logos to render with wrong colors. Removed
the invert filter from custom icon <img> tags in Layout.tsx and
AddExternalLinkModal.tsx. Preset Lucide icons are unaffected.
2026-02-09 08:35:07 +01:00
maziggy 7e5f494304 Complete Japanese locale overhaul: restructure and translate all keys
Restructured ja.ts from a divergent format (different nesting, 12
structural conflicts, 48 namespaces) to match EN/DE structure exactly
(41 namespaces, 0 conflicts). Translated all 2,083 EN keys into
Japanese — previously 1,366 keys were missing and silently falling
back to English via i18next fallbackLng.
2026-02-08 09:29:48 +01:00
maziggy 9cbd66593e Show Spoolman fill level for AMS Lite and external spools (#293)
AMS Lite units (A1 series) have no weight sensor and always report 0%
fill level. When a spool is linked to Spoolman with weight data, use
Spoolman's remaining weight as a fallback. External spools also show
fill level from Spoolman data instead of always showing unknown.

Backend: Enrich GET /spoolman/spools/linked response with
remaining_weight and filament_weight alongside spool ID.

Frontend: Add getSpoolmanFillLevel() helper. Update regular AMS, HT
AMS, and external spool fill computations to use Spoolman fallback
when AMS reports 0%. Show "(Spoolman)" indicator in hover card when
fill data comes from Spoolman.
2026-02-08 08:47:18 +01:00
maziggy 8511ce2c47 Add camera view controls: chamber light toggle & skip objects (fixes #291)
- Extract SkipObjectsModal from PrintersPage into reusable component
- Add chamber light toggle and skip objects buttons to EmbeddedCameraViewer
  and CameraPage header bars
- Add printerStatus query to camera views (React Query deduplicates with
  existing PrintersPage query)
- Fix camera/stop 401 when auth enabled: replace sendBeacon with
  fetch + keepalive + auth headers in both camera components
- Add camera.chamberLight i18n key (en, de, ja)
- Add AuthProvider to CameraPage test wrapper
2026-02-07 17:09:44 +01:00
maziggy 5803c8ceb1 Added missing toast messages to Spoolman settings 2026-02-06 14:12:12 +01:00
maziggy dc82b5ff2a Refactor Spoolman per-filament tracking (PR #277 follow-up)
Extract Spoolman tracking from main.py into dedicated service module,
DRY up repeated helpers, add i18n for new settings UI, and add tests.

- Move ~460 lines from main.py to services/spoolman_tracking.py
- Extract _resolve_spool_tag, _resolve_global_tray_id, build_ams_tray_lookup helpers
- Replace fragile tuple return in get_spoolman_settings() with dict
- Wire 4 new UI strings through i18n (en/de/ja)
- Add 42 backend unit tests (spoolman tracking helpers + 3MF parsing)
- Add 6 frontend tests for weight sync and partial usage toggles
- Update CHANGELOG, wiki, and website docs

Closes PR #277
2026-02-06 10:03:27 +01:00
maziggy 905e1762de Fix FTP settings UI: add selects, persist connection timeout
- Replace number inputs with select dropdowns for retry attempts,
  retry delay, and connection timeout to avoid auto-save race conditions
- Move connection timeout inside the FTP retry toggle section
- Add ftp_timeout to backend settings schema and integer parsing list
  so the value actually persists (was silently dropped before)

Closes #275
2026-02-06 09:20:33 +01:00
maziggy 46ba5ff417 Fix Bandit detection and update Trivy to v0.69.1
- Fix defusedxml import style in print_queue.py to be recognized by Bandit
  (use `import defusedxml.ElementTree as ET` not `from defusedxml import`)
- Update Trivy scanner version from 0.65.0 to 0.69.1
2026-02-05 17:50:16 +01:00
maziggy 2cac34795e Fix Safari camera stream failing with Service Worker error
Camera streams on macOS Safari were failing with "FetchEvent.respondWith
received an error: Load failed" because the Service Worker was intercepting
MJPEG streaming responses. Safari has known issues handling continuous
streaming responses through Service Workers.

- Add exclusion for /camera/stream and /camera/snapshot URLs in SW fetch handler
- Bump cache version to v24 to force SW update on clients

The camera components already have robust error handling with reconnect logic,
so bypassing the SW for these endpoints is safe and improves performance.
2026-02-05 11:05:46 +01:00
maziggy 00caf3ee1a Fix date format parsing for queue scheduling (#233)
Date input for scheduled prints was swapping month and day for European
users because:
1. EU format only accepted "/" separator, not "." which is common in
   European locales (e.g., "5.2.2026" for Feb 5th)
2. System format fell back to new Date() which interprets ambiguous
   dates in US format

Changes:
- Added splitDateParts() helper to accept /, ., and - separators
- Updated parseDateInput() to use proper locale detection for system
  format instead of relying on Date constructor
- All explicit formats (us, eu, iso) now accept any of the three
  separators

Closes #233
2026-02-05 08:00:34 +01:00
maziggy a92db92a0c Issue #265 Summary:
- Problem: Skip objects icon (z-10) overlays the 3-dot menu dropdown (z-10)
  - Fix: Increased menu dropdown z-index from z-10 to z-20
  - File: frontend/src/pages/PrintersPage.tsx:1606

Closes #265
2026-02-04 17:00:26 +01:00
maziggy 6a35e945ce Post work PR #262 2026-02-04 15:54:34 +01:00
maziggy 6577295cc2 Cleanup for PR #258 2026-02-04 14:58:38 +01:00
MartinNYHC cf286407fb Merge branch '0.1.8b' into cadtoolbox/248 2026-02-04 14:53:05 +01:00
maziggy cf6f374fee Fix filament hover card overlapping navigation bar (#259)
The FilamentHoverCard positioning logic now accounts for the fixed 56px
header when calculating available space above the trigger element.

Previously, when hovering over AMS slots near the top of the page, the
hover card would appear above the slot but go behind the navigation bar.
Now it correctly detects there isn't enough usable space and flips to
show below the slot instead.

Closes #259
2026-02-04 14:26:16 +01:00
maziggy 85598346f7 Issue #257 Fix:
- Changed the 401 handling in request() to only clear the auth token when the error message indicates the token is actually invalid
- Previously: ANY 401 response cleared the token (could cause cascading failures)
- Now: Only clears on specific messages like "Token has expired", "Could not validate credentials", etc.
- "Authentication required" (which might be a timing issue) no longer clears the token

Closes #257
2026-02-04 14:20:12 +01:00
maziggy 4910bce0b2 Fixed auth header for tasmota discovery 2026-02-04 14:10:11 +01:00
maziggy 3571cd1a42 Fix AMS auto-matching when multiple trays have same tray_info_idx
The tray_info_idx field is a filament TYPE identifier (e.g., "GFA00" for
generic PLA), not unique per spool. When multiple AMS trays are loaded
with the same filament type, the previous code used find() which always
returned the first match regardless of color.

Now checks if tray_info_idx is unique among available trays:
- If unique: use that tray as definitive match (existing behavior)
- If not unique: fall back to color matching among matching trays

Fixed in both backend (print_scheduler.py) and frontend (useFilamentMapping.ts).

Closes #245
2026-02-04 14:03:50 +01:00
maziggy 81d18cb8bd Virtual Printer Proxy Mode Improvements
- SSDP proxy for cross-network setups: select slicer network interface for automatic printer discovery via SSDP relay
- FTP proxy now listens on privileged port 990 (matching Bambu Studio expectations) instead of 9990
- For systemd: requires `AmbientCapabilities=CAP_NET_BIND_SERVICE` capability
- Automatic directory permission checking at startup with clear error messages for Docker/bare metal
2026-02-04 12:29:20 +01:00
copilot-swe-agent[bot]andcadtoolbox b9b5302bae Revert: Individual file card buttons should always be visible
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 11:14:09 +00:00
copilot-swe-agent[bot]andcadtoolbox c28fa602e5 Fix: Hide Print/Schedule buttons only when more than 1 file selected
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 11:05:12 +00:00
copilot-swe-agent[bot]andcadtoolbox 91af6f25f4 Hide Print and Schedule buttons in individual file actions when files are selected
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 11:02:00 +00:00
copilot-swe-agent[bot]andcadtoolbox 8ee8ad1867 Hide Uploaded By column and user filter when auth disabled
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 10:23:26 +00:00
copilot-swe-agent[bot]andcadtoolbox 6c85910e74 Update German translations to match English changes
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 10:01:47 +00:00
copilot-swe-agent[bot]andcadtoolbox af1c2e5ccb Update FileManagerPage test to use new "Schedule" button text
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 09:59:25 +00: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
copilot-swe-agent[bot]andcadtoolbox 80ec11a6df FileManager UI improvements complete - all requirements met
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 04:02:15 +00:00
copilot-swe-agent[bot]andcadtoolbox 4cf58f9805 Fix PrintModal to fetch library file sliced_for_model
- Added query to fetch library file details in PrintModal
- Updated backend FileResponse schema to include metadata fields (print_name, print_time_seconds, filament_used_grams, sliced_for_model)
- Updated backend get_file endpoint to extract and return metadata fields
- Updated frontend LibraryFile interface to include metadata fields
- Now slicedForModel is properly extracted from both archives and library files

Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 03:06:54 +00:00
copilot-swe-agent[bot]andcadtoolbox 6997180b50 Add schedulePrint translations and update tests
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 02:25:07 +00:00
copilot-swe-agent[bot]andcadtoolbox 6dda9ad34c Replace Add to Queue with Schedule dialog in FileManagerPage
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 02:21:08 +00:00
copilot-swe-agent[bot]andcadtoolbox 556493ff5b Implement hybrid upload: advanced 3MF extraction + basic upload for other files
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 00:36:07 +00:00
copilot-swe-agent[bot]andcadtoolbox 2ac9ae6178 Replace FileManagerPage upload with ArchivesPage UploadModal component
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-04 00:29:06 +00:00
MartinNYHC 685bf84de1 Merge branch '0.1.8b' into feature/updated_plate_view 2026-02-03 17:15:21 +01:00
MisterBeardy b2cc82480d rebase changes 2026-02-03 09:42:25 -05:00
maziggy ababe4e3ed Fix for Information exposure through an exception #72 2026-02-03 13:48:44 +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 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 24e35d963e Merge branch '0.1.7b' into feature/slicer-proxy 2026-02-03 10:04:18 +01:00
maziggy 5b98962938 Sync 2026-02-03 10:03:11 +01:00
maziggy bb61a1dbef Add TOTP authenticator support for Bambu Cloud login (fixes #182)
TOTP (Two-Factor Authentication):
- Detect TOTP vs email verification from Bambu API loginType response
- Use dedicated TFA endpoint on bambulab.com (not api.bambulab.com)
- Include browser-like headers to bypass Cloudflare protection
- Extract token from JSON response or cookies
- Frontend shows appropriate messages for each verification type
- Added i18n translations for TOTP UI (en, de, ja)

Closes #182
2026-02-03 09:12:31 +01:00
maziggy 6916bc8ed9 Added Japanese language pack (Thanks to @nmori) 2026-02-03 09:12:17 +01:00
maziggy 24a30e2452 Allow multiple Home Assistant entities per printer (fixes #214)
Both frontend and backend were blocking printers that already had any
smart plug linked, preventing users from adding multiple HA entities
to the same printer.

Changes:
- Frontend: Only filter out printers with existing Tasmota plugs
- Backend: Only check for duplicate Tasmota plugs on create/update
- HA entities (switches, scripts, lights, etc.) can now be linked
  multiple times to the same printer for different automations
- Tasmota plugs remain limited to one per printer (physical device)
- Restored "Show on Printer Card" toggle for HA entities
- Fixed printer card only showing script.* entities; now shows all
  HA entities with the toggle enabled
- HA entities now default to auto_on=False and auto_off=False
- Printer cards now update immediately when HA entities change

Closes #214
2026-02-03 09:08:12 +01:00
maziggy 7e298d8b85 Fix date picker format issues
Issue #233: Respect user date/time format in queue scheduler
- Replace native datetime-local input with custom text inputs
- Add date parsing/formatting utilities for US, EU, ISO, and system formats
- Add calendar button that opens native picker for convenience
- Pass dateFormat and timeFormat settings to ScheduleOptionsPanel
- Show format-appropriate placeholders (MM/DD/YYYY, DD/MM/YYYY, etc.)

Closes #233
2026-02-03 07:47:22 +01:00