Commit Graph

23 Commits

Author SHA1 Message Date
3613e7739a feat(auth): Add optional authentication system (#22)
Some checks failed
CI / style (push) Has been cancelled
CI / build-client (push) Has been cancelled
CI / build-amd64 (push) Has been cancelled
CI / build-tester (push) Has been cancelled
CI / test (cockroachdb) (push) Has been cancelled
CI / test (mariadb) (push) Has been cancelled
CI / test (postgres) (push) Has been cancelled
CI / test (sqlite) (push) Has been cancelled
CI / build-arm64 (push) Has been cancelled
CI / build-armv7 (push) Has been cancelled
CI / publish-images (push) Has been cancelled
CI / publish-release (push) Has been cancelled
Backend:
- Add User model with username, hashed password, role, is_active
- Add passlib[bcrypt] and python-jose[cryptography] dependencies
- Create auth.py with JWT utilities, password hashing, role checking
- Add /auth endpoints: status, setup, login, me, users CRUD
- Add role-based permission system (viewer/operator/editor/admin)
- Environment: SPOOLMAN_AUTH_ENABLED, SPOOLMAN_AUTH_SECRET_KEY
- Migration for user table

Frontend:
- Add AuthProvider context with login/logout/setup
- Add LoginPage component with setup mode for first user
- Add ProtectedRoute wrapper for auth-required pages
- Add axios interceptor to attach JWT token to requests
- Add User Management tab in Settings (admin only)
- Add translation keys for auth UI

When SPOOLMAN_AUTH_ENABLED=true:
- Users must login to access the app
- First visit shows setup page to create admin account
- Role-based access control for future endpoint protection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 00:15:36 -06:00
4cd58ebae9 Add Print Job tracking for slicer integration
Backend for tracking print jobs from Elegoo/Orca Slicer:

- PrintJob model: tracks pending/completed/cancelled jobs
- API endpoints: create, list, complete, cancel jobs
- needs_weighing flag on Spool: for cancelled print recalibration
- Database migration for new table and column

Workflow:
1. Slicer post-processing script creates pending job
2. User completes job → auto-deducts filament
3. User cancels job → flags spool for manual weigh-in

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 21:10:56 -06:00
d804329b77 feat: Add spool adjustment history tracking (#6)
Track history of all spool weight/length adjustments with timestamps and comments:

Backend:
- Add SpoolAdjustment database model with spool_id, timestamp, type, value, comment
- Add Alembic migration for spool_adjustment table
- Add SpoolAdjustment Pydantic model for API responses
- Update use_weight, use_length, and measure functions to record adjustments
- Add GET /api/v1/spool/{id}/adjustments endpoint for history retrieval
- Add optional comment parameter to use/measure endpoints

Frontend:
- Add ISpoolAdjustment interface to spool model
- Add collapsible adjustment history table to spool show page
- Display timestamp, type (weight/length), amount, and comment
- Add translation keys for history table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 20:18:56 -06:00
3451996a8f feat: Add temperature ranges for extruder and bed temps (#5)
Some checks failed
CI / style (push) Has been cancelled
CI / build-client (push) Has been cancelled
CI / build-amd64 (push) Has been cancelled
CI / build-tester (push) Has been cancelled
CI / test (cockroachdb) (push) Has been cancelled
CI / test (mariadb) (push) Has been cancelled
CI / test (postgres) (push) Has been cancelled
CI / test (sqlite) (push) Has been cancelled
CI / build-arm64 (push) Has been cancelled
CI / build-armv7 (push) Has been cancelled
CI / publish-images (push) Has been cancelled
CI / publish-release (push) Has been cancelled
Store extruder and bed temperatures as min/max ranges instead of
single values for more accurate filament specifications.

Backend changes:
- Add 4 new columns: settings_extruder_temp_min/max, settings_bed_temp_min/max
- Keep old columns for backward compatibility (marked deprecated)
- Alembic migration copies existing values to both min and max
- Update Pydantic models and API endpoints

Frontend changes:
- Filament model updated with new fields
- Create form uses min/max input pairs with Space.Compact
- Import from external DB populates both min and max with same value
- Label template updated to show ranges: "ET: 190-220 °C"
- Template help includes new tags

Labels now display temperature ranges like "190-220°C" which is more
useful for printing than a single recommended value.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 20:05:02 -06:00
Donkie
8c164ac55f Added backend support for multi-color filaments 2024-05-28 18:49:24 +02:00
Donkie
535fa40ad2 Updated most python dependencies
Primarily FastAPI and Pydantic to v2. Also ruff to latest.

Updated some code to support Pydantic v2
2024-05-23 19:42:27 +02:00
Donkie
1e4c73138c Added external ID fields to filaments and vendors 2024-05-12 21:58:00 +02:00
Matt Gerega
1ec16e64fb Updated calculation of default values during migration and added additional help 2024-04-15 10:44:03 -04:00
Matt Gerega
c6f9abeced Changed initial_weight to be net weight, not gross weight 2024-04-10 11:00:46 -04:00
Matt Gerega
e68f88da2a Added empty spool weight as an option field for the vendor 2024-03-26 20:35:50 -04:00
Matt Gerega
83fd3073ec Fixed formatting 2024-03-26 14:02:17 -04:00
Matt Gerega
1d6830d769 Added initial_weight and empty_weight to spool 2024-03-26 13:55:44 -04:00
Donkie
77ac9d6a5c Added custom extra fields to backend
No integration tests yet, TBD
2024-01-23 18:58:57 +01:00
Donkie
5900f2248a Updated settings migration 2024-01-16 19:20:44 +01:00
Donkie
44da991d47 Added a new backend settings system
This can be used for saving runtime-configurable settings in the database.
2024-01-16 19:17:06 +01:00
pdsccode
44b20fb360 Fixed code formatting 2024-01-07 13:25:05 +01:00
pdsccode
df45a47b99 Added db migration for spool prices 2023-12-30 08:44:54 +01:00
Donkie
af77bf6c26 Updated migration to support sqlite 2023-08-12 22:33:20 +02:00
Donkie
4cb2542a41 Added support for color_hex alpha channel 2023-08-12 21:32:20 +02:00
Donkie
f89cf8ecd4 Added archived field to spools
Resolves #13
2023-07-14 14:19:57 +02:00
Donkie
4e409f6bb6 Added filament color code field 2023-06-01 19:56:24 +02:00
Donkie
7c7ee9296c Added extruder/bed temp override settings
Closes #4
2023-05-28 21:52:51 +02:00
Donkie
de1bf05922 Added Alembic for migrations 2023-05-27 23:14:06 +02:00