Commit Graph
1847 Commits
Author SHA1 Message Date
maziggy f8220e8931 Changed version 2026-01-23 10:59:21 +01:00
maziggy 179499359d Rearranged network setting cards 2026-01-23 10:10:13 +01:00
maziggy 6225fac398 Multiple fixes and ZIP file support in File Manager
Features:
  - ZIP file support in File Manager (Issue #121): Upload ZIP files to
    automatically extract contents with option to preserve folder structure
  - Delete operation loading indicator: Shows progress during folder/file
    deletion operations

Fixed:
  - Print time stats using actual elapsed time instead of slicer estimates
    (Issue #137)
  - Skip objects modal overflow with scrollable list for many objects
    (Issue #134)

Removed:
  - Duplicate badge feature from File Manager (per user request)

Tests:
  - Added ZIP extraction backend tests (5 tests)
  - Added ConfirmModal loading state frontend tests (5 tests)
2026-01-23 09:02:25 +01:00
maziggy ea570a12f5 Skip objects modal overflow
Modal now has max height (85vh) with scrollable object list when printing many items on the bed

Closes #134
2026-01-23 08:24:30 +01:00
maziggy a6b1c5adbe Print time stats using slicer estimates
Quick Stats "Print Time" now uses actual elapsed time (`completed_at - started_at`) instead of slicer estimates;
cancelled prints only count time actually printed

Closes #137
2026-01-23 08:20:19 +01:00
maziggy ecd6c3e152 Updated README 2026-01-23 08:09:39 +01:00
maziggy d6f76db81a Updated README 2026-01-23 08:09:24 +01:00
maziggy 79333045aa Updated README 2026-01-23 08:07:48 +01:00
maziggy df66f9aa14 Updated README 2026-01-23 08:07:29 +01:00
maziggy 3991c2b154 Updated CHANGELOG 2026-01-23 07:56:44 +01:00
maziggy 4a3e42db36 Home Assistant smart plug improvements:
- Add search parameter to /ha/entities endpoint for searching all entities
- Replace entity dropdown with searchable combobox (type to filter)
- Default shows switch/light/input_boolean; search queries all domains
- Make all three energy sensor dropdowns searchable (Power, Energy Today, Total)
- Each dropdown filters by entity_id or friendly_name
- Shows entity details (name, id, state, unit) in dropdown options

Fixes issue where HA plugs with non-standard entity naming couldn't
find their related power/energy sensors.
2026-01-23 07:52:56 +01:00
maziggy f9915237a2 The camera viewer now has proper zoom and fullscreen support for both viewing modes
Closes #132
2026-01-23 07:28:39 +01:00
maziggy 6c5aad1b73 Fix: Mattermost/Slack Webhook Support
Root Cause: The generic webhook sent a JSON payload with custom field names plus timestamp and source fields. Mattermost/Slack webhooks only accept {"text": "..."}
format and reject unknown fields with HTTP 400.

Users just need to select "Slack / Mattermost" from the Payload Format dropdown when configuring their Mattermost webhook.

Closes #133
2026-01-23 07:13:46 +01:00
maziggy 08e4797544 Fix: Internal Model Code Detection for Camera Protocol
Root Cause: P2S (and other newer models) may report their model as internal codes (e.g., "N7" for P2S) rather than display names in MQTT/SSDP responses. The camera code
only checked for display names like "P2S", causing it to incorrectly use the chamber image protocol (for A1/P1) instead of RTSP.

Internal Code Mapping:
BL-P001 → X1/X1C (RTSP)
C13     → X1E    (RTSP)
O1D     → H2D    (RTSP)
O1C     → H2C    (RTSP)
O1S     → H2S    (RTSP)
O1E     → H2D Pro (RTSP)
N7      → P2S    (RTSP)
C11     → P1P    (Chamber)
C12     → P1S    (Chamber)
N2S     → A1     (Chamber)
N1      → A1 Mini (Chamber)

Closes #127
2026-01-23 07:09:22 +01:00
MartinNYHC ce8968f893 Merge pull request #128 from JesseFPV/0.1.6b11
Fixed re-auth setup and gitignore node modules
2026-01-22 12:33:05 +01:00
maziggy 4babcf6187 Updated CI 2026-01-22 12:32:45 +01:00
JesseFPV 3a848643c0 Fixed re-auth setup and gitignore node modules 2026-01-22 12:21:07 +01:00
maziggy 0c864dc3f4 Updated Github issue template
- Support Package section - A markdown block with instructions to download the support package
  from Settings → System Info, plus a link to the debug logging guide
- P2S added - Added to the printer model dropdown between P1P and A1
2026-01-22 10:50:14 +01:00
maziggy 821d3ba748 Updated Github issue template
- Support Package section - A markdown block with instructions to download the support package
  from Settings → System Info, plus a link to the debug logging guide
- P2S added - Added to the printer model dropdown between P1P and A1
2026-01-22 10:48:55 +01:00
maziggy 0354218657 Add finish photo URL to notification templates (Issue #126)
- Add {finish_photo_url} template variable for print_complete, print_failed,
  print_stopped events
- Photo capture now completes before notification is sent (ensures image exists)
- Add External URL setting in Settings → Network (auto-detects from browser)
- Full URL constructed using external_url setting for external services
- Fix Telegram Markdown parsing error when messages contain URLs
- Add backend schema for external_url setting
- Add unit test for finish_photo_url variable passing
2026-01-22 10:42:20 +01:00
maziggy 0caa68b77f Auto-create Spoolman 'tag' extra field on connect (Issue #123)
The 'tag' extra field is required in Spoolman for storing RFID/UUID
identifiers that link Bambu Lab spools to Spoolman entries. Previously,
users had to manually create this field in Spoolman, causing sync
failures for fresh installations.

Added ensure_tag_extra_field() method to SpoolmanClient that:
- Checks if the 'tag' field exists via GET /api/v1/field/spool/tag
- Creates it via POST if missing

The method is called automatically:
- On app startup when auto-connecting to Spoolman
- When user clicks "Connect" in Spoolman settings
2026-01-22 09:23:40 +01:00
maziggy 01ab2cbb45 Fix filament cost not using default setting
The "Default filament cost (per kg)" setting was being ignored when
calculating filament costs. A hardcoded value of 25.0 was used instead.

All three now read the default_filament_cost setting from the database,
falling back to 25.0 only if the setting doesn't exist.

Users can run "Recalculate Costs" from the Archives page to update
existing archives with the correct default cost.
2026-01-22 09:13:48 +01:00
maziggy d6935c9253 Add Home Assistant energy sensor entity support (Issue #119)
Home Assistant smart plugs can now use separate sensor entities for
energy monitoring, enabling energy tracking for plugs that expose
power/energy data as separate sensors (Tapo, IKEA Zigbee2mqtt, etc.).

Features:
- Configure dedicated power (W), today (kWh), and total (kWh) sensors
- New API endpoint GET /api/v1/smart-plugs/ha/sensors lists available sensors
- Falls back to switch entity attributes if no sensors configured
- Print energy tracking now works for HA plugs (not just Tasmota)

Backend:
- Added ha_power_entity, ha_energy_today_entity, ha_energy_total_entity
  fields to SmartPlug model
- Updated get_energy() to fetch from configured sensor entities
- Added _get_plug_energy() helper to handle both plug types
- Updated backup/restore to include new fields
- Added database migration for new columns

Frontend:
- Added energy sensor dropdowns in AddSmartPlugModal (shown for HA plugs)
- Dropdowns filtered by unit (W/kW for power, kWh/Wh for energy)

Tests:
- Added 4 new integration tests for HA energy sensor functionality

Docs:
- Updated README with new feature
- Updated CHANGELOG with 0.1.6b11 entry
2026-01-22 09:04:40 +01:00
maziggy fa9a154c5d Added back navigation to user management page 2026-01-21 16:51:17 +01:00
maziggy f334c74d02 Post tasks for PR #117 (Authentication Feature)
Fixes:

  - Fixed is_auth_enabled() returning None instead of False when setting doesn't exist (in both auth.py and routes/auth.py)
  - Fixed get_current_user() crashing when credentials is None
  - Added missing async_session patch in conftest.py for auth tests

  Backup/Restore - Added Users Support
  - Added include_users parameter to backup export
  - Users are exported with username, role, and is_active (passwords excluded for security)
  - Restore creates users with temporary passwords that must be changed

Backend Tests - 16 New Auth Tests
  - test_auth_api.py with tests for:
  - Auth status endpoint
  - Auth setup (enable/disable)
  - Login flow (success, invalid credentials, auth disabled)
  - /me endpoint with/without token
  - User management (list, create, update, delete)
  - Auth disable

Frontend Tests - 6 New Login Tests
  - LoginPage.test.tsx with tests for:
  - Form rendering
  - Input validation
  - Login submission
  - Loading states

Documentation Updates
  - CHANGELOG.md/README.md: Added authentication feature description
  - Website (features.html): Added new "Optional Authentication" section
  - Wiki: Created authentication.md with full documentation
  - Wiki index: Added authentication to features list
2026-01-21 16:41:37 +01:00
maziggy dc30856238 Fixed background tests to support new authentication and user module 2026-01-21 16:25:35 +01:00
maziggy 2e7caf38da Added from future import annotations which defers annotation evaluation so APIKey doesn't need to be imported at runtime. 2026-01-21 16:15:53 +01:00
maziggy af49d7686e Added optional authentication and user management 2026-01-21 16:04:50 +01:00
maziggy 7bca0d733f Fixed Github CI 2026-01-21 16:02:30 +01:00
MartinNYHC 8614252aa8 Merge pull request #118 from maziggy/revert-117-main
Revert "Added optional authentication and user management"
2026-01-21 15:59:13 +01:00
MartinNYHC a9f340f2c9 Revert "Added optional authentication and user management" 2026-01-21 15:58:24 +01:00
MartinNYHC c3cbdd8d73 Merge pull request #117 from JesseFPV/main
Added optional authentication and user management
2026-01-21 15:58:06 +01:00
JesseFPV 6e5cc55190 Fixed auth check and conftest 2026-01-21 15:36:39 +01:00
maziggy 0d1056ded4 Added timeouts to Github CI runner
- Backend tests: 10 min (step-level)
- Frontend tests: 10 min (step-level)
- Docker tests: 20 min (job-level, since it has multiple build/test steps)
2026-01-21 15:27:24 +01:00
JesseFPV deeaabfa8d Fixed frontend lint test error 2026-01-21 15:13:27 +01:00
JesseFPV d731cd2a91 Fixed lint errors 2026-01-21 14:50:31 +01:00
JesseFPV 3e1843f834 Updated checks 2026-01-21 14:41:24 +01:00
JesseFPV f8857ba666 Added optional authentication and user management 2026-01-21 14:10:06 +01:00
MartinNYHC aee245c124 Merge pull request #115 from maziggy/0.1.6b10
v0.1.6b10

### New Features
- **Unified Print Modal** - Consolidated three separate modals into one unified component:
  - Single modal handles reprint, add-to-queue, and edit-queue-item operations
  - Consistent UI/UX across all print operations
  - Reduced code duplication (~1300 LOC removed)
- **Multi-Printer Selection** - Send prints or queue items to multiple printers at once:
  - Checkbox selection for multiple printers in reprint and add-to-queue modes
  - "Select all" / "Clear" buttons for quick selection
  - Progress indicator during multi-printer submission
  - Ideal for print farms with identical filament configurations
- **Per-Printer AMS Mapping** - Configure filament slot mapping individually for each printer:
  - Enable "Custom mapping" checkbox under each selected printer
  - Auto-configure uses RFID data to match filaments automatically
  - Manual override for specific slot assignments
  - Match status indicator shows exact/partial/missing matches
  - Re-read button to refresh printer's loaded filaments
  - New setting in Settings → Filament to expand custom mapping by default
- **Enhanced Add-to-Queue** - Now includes plate selection and print options:
  - Configure all print settings upfront instead of editing afterward
  - Filament mapping with manual override capability
- **Print from File Manager** - Full print configuration when printing from library files:
  - Plate selection for multi-plate 3MF files with thumbnails
  - Filament slot mapping with comparison to loaded filaments
  - All print options (bed levelling, flow calibration, etc.)
- **File Manager Print Button** - Print directly from multi-selection toolbar:
  - "Print" button appears when exactly one sliced file is selected
  - Opens full PrintModal with plate selection and print options
  - "Add to Queue" button now uses Clock icon for clarity
- **Multiple Embedded Camera Viewers** - Open camera streams for multiple printers simultaneously in embedded mode:
  - Each viewer has its own remembered position and size
  - New viewers are automatically offset to prevent stacking
  - Printer-specific persistence in localStorage
  - **Navigation persistence** - Open cameras stay open when navigating away and back to Printers page
- **Application Log Viewer** - View and filter application logs in real-time from System Information page:
  - Start/Stop live streaming with 2-second auto-refresh
  - Filter by log level (DEBUG, INFO, WARNING, ERROR)
  - Text search across messages and logger names
  - Clear logs with one click
  - Expandable multi-line log entries (stack traces, etc.)
  - Auto-scroll to follow new entries
- **Deferred archive creation** - Queue items from File Manager no longer create archives upfront:
  - Queue items store `library_file_id` directly
  - Archives are created automatically when prints start
  - Reduces clutter in Archives from unprinted queued files
  - Queue displays library file name, thumbnail, and print time
- **Expandable Color Picker** - Configure AMS Slot modal now has an expandable color palette:
  - 8 basic colors shown by default (White, Black, Red, Blue, Green, Yellow, Orange, Gray)
  - Click "+" to expand 24 additional colors (Cyan, Magenta, Purple, Pink, Brown, Beige, Navy, Teal, Lime, Gold, Silver, Maroon, Olive, Coral, Salmon, Turquoise, Violet, Indigo, Chocolate, Tan, Slate, Charcoal, Ivory, Cream)
  - Click "-" to collapse back to basic colors
- **File Manager Sorting** - Printer file manager now has sorting options:
  - Sort by name (A-Z or Z-A)
  - Sort by size (smallest or largest first)
  - Sort by date (oldest or newest first)
  - Directories always sorted first
- **Camera View Mode Setting** - Choose how camera streams open:
  - "New Window" (default): Opens camera in a separate browser window
  - "Embedded": Shows camera as a floating overlay on the main screen
  - Embedded viewer is draggable and resizable with persistent position/size
  - Configure in Settings → General → Camera section
- **File Manager Rename** - Rename files and folders directly in File Manager:
  - Right-click context menu "Rename" option for files and folders
  - Inline rename button in list view
  - Validates filenames (no path separators allowed)
- **File Manager Mobile Accessibility** - Improved touch device support:
  - Three-dot menu button always visible on mobile (hover-only on desktop)
  - Selection checkbox always visible on mobile devices
  - Better PWA experience for file management

### Changed
- **Edit Queue Item modal** - Single printer selection only (reassigns item, doesn't duplicate)
- **Edit Queue Item button** - Changed from "Print to X Printers" to "Save"

### Fixed
- **File Manager folder navigation** - Fixed bug where opening a folder would briefly show files then jump back to root:
  - Removed `selectedFolderId` from useEffect dependency array that was causing a reset loop
  - Folder navigation now works correctly without resetting
- **Queue items with library files** - Fixed 500 errors when listing/updating queue items from File Manager
- **User preset AMS configuration** - Fixed user presets (inheriting from Bambu presets) showing empty fields in Bambu Studio after configuration:
  - Now correctly derives `tray_info_idx` from the preset's `base_id` when `filament_id` is null
  - User presets that inherit from Bambu presets (e.g., "# Overture Matte PLA @BBL H2D") now work correctly
- **Faster AMS slot updates** - Frontend now updates immediately after configuring AMS slots:
  - Added WebSocket broadcast to AMS change callback for instant UI updates
  - Removed unnecessary delayed refetch that was causing slow updates
v0.1.6b10
2026-01-21 09:44:35 +01:00
maziggy a0650edd5b Fixed bug in Dockerfile 2026-01-21 09:33:12 +01:00
maziggy ac84174e46 Updated CHANGELOG 2026-01-21 09:22:06 +01:00
MartinNYHC 3461b7206d Merge pull request #114 from maziggy/main
Sync
2026-01-21 09:19:23 +01:00
maziggy c6ad12e4af Add navigation persistence for embedded camera viewers
Embedded camera viewers now stay open when navigating away from the
Printers page and back. Previously, users had to reopen each camera
view manually after navigation.
2026-01-21 07:00:52 +01:00
MartinNYHC ccec881a96 Merge pull request #113 from maziggy/maziggy-patch-1
Updated README
2026-01-21 06:50:47 +01:00
maziggy 00fbc87309 Fixed lint issues 2026-01-21 06:48:20 +01:00
MartinNYHC c0946cddb4 Updated README 2026-01-21 06:44:40 +01:00
maziggy 9f396644da Updated README 2026-01-21 06:41:48 +01:00
maziggy 64057afe2c Fixed bug in global print modal 2026-01-21 06:18:56 +01:00
maziggy a33246a060 Fixed caching for file manager 2026-01-21 06:06:47 +01:00
maziggy 576734c897 Fixed frontend/backend tests 2026-01-20 17:50:16 +01:00