Commit Graph

82 Commits

Author SHA1 Message Date
613176dd42 feat: Add database import/export functionality (Issue #10)
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:
- New /api/v1/backup/export endpoint - exports all data as single JSON
- New /api/v1/backup/import endpoint - imports JSON with merge or replace
- Handles vendors, filaments, spools, adjustments, settings
- Remaps IDs to maintain relationships during import

Frontend:
- Added Backup & Restore section to Settings page
- Download Backup button for export
- Import with merge or replace options
- Warning confirmation for replace mode

This enables migrating between PostgreSQL and SQLite databases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 22:47:09 -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
70ea7ad414 Update python dependencies and ruff/black versions 2025-03-16 21:34:02 +01:00
Donkie
139d435cee Fixed manufacturer with spool weight 0 not being allowed
Resolves #521
2024-11-25 20:49:39 +01:00
Donkie
37b6d1fcee Added ability to rename location 2024-11-20 21:00:39 +01:00
Donkie
86f69d470f Added backend supported csv/json export functionality 2024-10-27 12:36:39 +01:00
Donkie
93d27a96d3 Spool weight can now be set to 0
Fixes #422
2024-08-05 19:39:54 +02:00
Donkie
8c164ac55f Added backend support for multi-color filaments 2024-05-28 18:49:24 +02:00
Donkie
b00075ab87 Added backend support to perform exact matches 2024-05-25 20:56:22 +02:00
Donkie
c851950701 Tests fully pass again 2024-05-23 20:13:51 +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
e4d2ecf0dc Filament/vendor find by ext id + integration tests 2024-05-12 21:58:01 +02:00
Donkie
4af975d390 Removed 404 codes from find apis because they will never return that 2024-05-12 21:58:01 +02:00
Donkie
1e4c73138c Added external ID fields to filaments and vendors 2024-05-12 21:58:00 +02:00
Donkie
eca8e32a55 Removed plural from new api to match others 2024-05-12 21:57:43 +02:00
Donkie
cbaa7b81df Added API for fetching external database, removed parameters structure, 2024-05-12 12:14:25 +02:00
Matt Gerega
c6f9abeced Changed initial_weight to be net weight, not gross weight 2024-04-10 11:00:46 -04:00
Matt Gerega
dad446621f Changed g to grams in API docs for clarity 2024-04-08 17:40:22 -04:00
Matt Gerega
23cfb42ba8 Updated based on PR requests 2024-04-08 17:38:18 -04:00
Matt Gerega
19c414da4b Add integration tests for new measure endpoint 2024-03-27 15:44:54 -04:00
Matt Gerega
3ea4937f24 Updated spool UIs (create/edit) 2024-03-27 14:47:05 -04:00
Matt Gerega
3aed735cea Updated vendor API to correct issues - Implement new UI 2024-03-26 21:26:41 -04:00
Matt Gerega
1d6830d769 Added initial_weight and empty_weight to spool 2024-03-26 13:55:44 -04:00
Donkie
06e3849862 No longer need to specify entity_type in body 2024-01-23 18:58:57 +01:00
Donkie
77ac9d6a5c Added custom extra fields to backend
No integration tests yet, TBD
2024-01-23 18:58:57 +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
50ac398519 Fixed missing comma in api model spool price 2023-12-30 09:29:26 +01:00
pdsccode
f659284bed Fixed api missing spool price return 2023-12-30 09:28:08 +01:00
Sebastian
0185cbf43e Resolved indentation error 2023-12-30 08:30:17 +01:00
pdsccode
1eb78f01df Added pricing field for single spool 2023-12-30 07:29:27 +01:00
Donkie
cf8d7472f5 Added backend filament search by similar color 2023-12-19 21:37:07 +01:00
Donkie
d119a27cc2 Added separate get_logs_dir function for logs dir
Instead of piggy-backing on the data dir
2023-11-25 21:42:56 +01:00
Donkie
5f7a063125 Added resource field in websocket message
Used to differentiate resources for root-level subscriptions
2023-10-15 20:39:53 +02:00
Donkie
3e2bbed17e Added more websocket endpoints
Can now subscribe to:
- spool/filament/vendor level events, not specific to any specific ID
- root level events, captures all events sent
2023-10-15 20:36:48 +02:00
Donkie
7a3c2e3a68 Added event response model in api documentation 2023-10-15 19:46:28 +02:00
Donkie
a6d527aaf0 Added/deleted-type websocket messages
Events are now sent for not only when an object changes but also when one is created or deleted.

For now it's not really possible to subscribe to these events however.

This breaks backwards-compatibility with the websocket messages.
2023-10-15 19:46:10 +02:00
Donkie
3c5b3cea5a Added websocket endpoints for filament and vendors 2023-10-15 15:39:39 +02:00
Donkie
205574fa2c Fixed timezone being returned incorrectly
Happened if you've set TZ to non-UTC.

Apparently astimezone and replace doesn't do the same thing even if tzinfo is None.
2023-10-02 21:36:50 +02:00
Donkie
82600347da Improved API documentation regarding empty fields 2023-09-20 21:10:38 +02:00
Donkie
b795680226 Added missing timezone in responses
Fixes #114
2023-09-20 20:13:02 +02:00
Donkie
cadb707fdd Added WebSocket notify API for spools 2023-09-17 22:00:00 +02:00
Donkie
1a3efd9ea9 Added git commit and build date env and API 2023-09-17 10:51:28 +02:00
Donkie
6f94c17050 Renamed vendor.x to filament.vendor.x in spool API 2023-09-16 11:13:30 +02:00
Donkie
6ee3b8df70 Added support for multiple int where's 2023-09-16 11:13:30 +02:00
Donkie
e436aa4975 Added tests for spool find sorting 2023-09-16 11:13:30 +02:00
Donkie
826fde6967 API find nested filters now specified using period
Previously you used underscore, like vendor_name. This made fields like filament_article_number have ambiguous underscores.
2023-09-16 11:13:30 +02:00
Donkie
4b33ba0b1c Renamed locations endpoint to location 2023-09-16 11:13:30 +02:00
Donkie
e2d937aaf1 Added x-total-count response header 2023-09-16 11:13:30 +02:00
Donkie
557ea82171 Added endpoints for getting list of materials, etc 2023-09-16 11:13:30 +02:00