Show spool availability indicator per job on jobs list
- filamentdb.spool_counts(): builds (material, color_name) → roll count from cached stock report; counts rolls_in_stock + rolls_in_use (non-graveyard) - Jobs list: coloured dot before material — green (2+), yellow (1), red (0) - FILAMENTDB_URL added to .env Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ from app.models.printer_type import PrinterType
|
||||
from app.models.pricing import PricingConfig
|
||||
from app.models.todo import Todo
|
||||
from app.constants import COLORS, MATERIALS
|
||||
from app.filamentdb import available_colors, available_materials, get_stock
|
||||
from app.filamentdb import available_colors, available_materials, get_stock, spool_counts
|
||||
from app.stl import get_stl_dir, list_stl_files
|
||||
from app.stl_analysis import analyse, get_cache_map # noqa: F401 used in job_detail route
|
||||
|
||||
@@ -145,6 +145,7 @@ def jobs_page(request: Request, q: str = "", db: Session = Depends(get_db)):
|
||||
"stl_cache": get_cache_map(stl_files, db),
|
||||
"materials": available_materials() or MATERIALS,
|
||||
"colors": available_colors() or COLORS,
|
||||
"spool_map": spool_counts(),
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user