feat: Add 3dfilamentprofiles.com integration (Issue #7)
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
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: Added ExternalSource enum, Filament3DFP model, and transform function - Backend: Updated _sync() to fetch from both SpoolmanDB and 3dfilamentprofiles - Frontend: Added source tabs to FilamentImportModal (All/SpoolmanDB/3DFP) - Frontend: Updated ExternalFilament interface with source and temp range fields - Frontend: Updated filament import handler to use temp range fields Also includes: - Dev mode styling (teal theme, DEV badge and banner) - Translation keys for source filtering Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
74
CLAUDE.md
74
CLAUDE.md
@@ -132,7 +132,9 @@ This is a fork with UX improvements. Issues are tracked on the Gitea instance ab
|
||||
| 4 | Layout Max-Width | ✅ DONE |
|
||||
| 5 | Temperature Ranges | ✅ DONE |
|
||||
| 6 | Spool Adjustment History | ✅ DONE |
|
||||
| 7 | 3dfilamentprofiles Integration | Open |
|
||||
| 7 | 3dfilamentprofiles Integration | ✅ DONE |
|
||||
| 8 | (see Gitea #8) | ✅ DONE |
|
||||
| 9 | Hierarchical Locations (Room/Bin) | Open |
|
||||
|
||||
### Issue #1 Complete - Inline Creation Modals
|
||||
|
||||
@@ -213,3 +215,73 @@ Frontend:
|
||||
- `client/src/pages/spools/model.tsx` - Added `ISpoolAdjustment` interface
|
||||
- `client/src/pages/spools/show.tsx` - Collapsible adjustment history table
|
||||
- `client/public/locales/en/common.json` - Translation keys for history table
|
||||
|
||||
### Issue #7 Complete - 3dfilamentprofiles Integration
|
||||
|
||||
Added 3dfilamentprofiles.com as a second external database source alongside SpoolmanDB.
|
||||
|
||||
Backend (`spoolman/externaldb.py`):
|
||||
- Added `ExternalSource` enum (SPOOLMANDB, FILAMENT_PROFILES_3D)
|
||||
- Added `Filament3DFP` model for raw 3dfp data
|
||||
- Added `_transform_3dfp_to_external()` to convert 3dfp format to ExternalFilament
|
||||
- Updated `_sync()` to fetch from both sources and merge results
|
||||
- Environment variables: `EXTERNAL_DB_3DFP_URL`, `EXTERNAL_DB_3DFP_ENABLED`
|
||||
|
||||
Frontend:
|
||||
- `client/src/utils/queryExternalDB.ts` - Added `ExternalSource` enum, `source` field, temp range fields
|
||||
- `client/src/components/filamentImportModal.tsx` - Added tabs to filter by source (All/SpoolmanDB/3DFP)
|
||||
- `client/src/pages/filaments/create.tsx` - Updated import handler for temp range fields
|
||||
|
||||
Data mapping (3dfp → Spoolman):
|
||||
- `brand_name` → `manufacturer`
|
||||
- `color` + `material_type` → `name`
|
||||
- `rgb` → `color_hex` (strip # prefix)
|
||||
- `properties.temp_min/max` → `extruder_temp/extruder_temp_max`
|
||||
- `properties.bed_temp_min/max` → `bed_temp/bed_temp_max`
|
||||
- Diameter defaults to 1.75mm (3dfp doesn't provide)
|
||||
- Density from material lookup table
|
||||
|
||||
---
|
||||
|
||||
## Local Development Setup
|
||||
|
||||
To run locally against the Unraid PostgreSQL database:
|
||||
|
||||
```bash
|
||||
# Create virtualenv and install deps
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -e ".[postgres]"
|
||||
|
||||
# Start backend (reads .env file)
|
||||
source .venv/bin/activate
|
||||
export $(grep -v '^#' .env | xargs)
|
||||
uvicorn spoolman.main:app --host 0.0.0.0 --port 7912
|
||||
|
||||
# Start frontend (separate terminal)
|
||||
cd client
|
||||
VITE_APIURL=http://localhost:7912/api/v1 npm run dev
|
||||
```
|
||||
|
||||
Access at http://localhost:5173
|
||||
|
||||
### Dev Mode Styling
|
||||
|
||||
Files modified for dev version visual distinction:
|
||||
- `client/src/contexts/color-mode/index.tsx` - Teal primary color (#0891b2)
|
||||
- `client/src/components/layout.tsx` - "DEV BUILD" banner and badge
|
||||
|
||||
Set `IS_DEV = false` in layout.tsx to disable dev styling.
|
||||
|
||||
---
|
||||
|
||||
## Known Issues / TODO
|
||||
|
||||
### Filament Select Not Refreshing After Inline Creation
|
||||
When creating a filament via the inline modal on spool create page, the select dropdown doesn't immediately show the new filament with its name (shows ID instead).
|
||||
|
||||
Attempted fixes:
|
||||
- Added `refetch` from `useGetFilamentSelectOptions` hook
|
||||
- Called `await refetchFilaments()` before setting form value
|
||||
|
||||
Still not working reliably. May need to investigate react-query cache invalidation timing or add the new option manually to the select options array.
|
||||
|
||||
Reference in New Issue
Block a user