|
19 | 19 | from fastapi.responses import RedirectResponse, JSONResponse |
20 | 20 | from fastapi.templating import Jinja2Templates |
21 | 21 | from fastapi.websockets import WebSocket |
22 | | -from pydantic import BaseModel |
| 22 | +from pydantic import BaseModel, Field |
23 | 23 | from websockets.exceptions import ConnectionClosed |
24 | 24 |
|
25 | 25 | THREADS = int(os.environ.get('CUSTOMIZER_THREADS', 10)) |
@@ -263,7 +263,7 @@ class CustomVariables(BaseModel): |
263 | 263 | m3_screw_diameter_tight: float = 3 |
264 | 264 | m3_screw_diameter_loose: float = 3.25 |
265 | 265 | m3_insert_hole_diameter: float = 4 |
266 | | - m3_hex_nut_diameter: float = 6 |
| 266 | + m3_hex_nut_diameter: float = Field(6, title='The height in cm', ge=5, le=6) |
267 | 267 | SeatPostMount_angle: float = 20 |
268 | 268 | SeatPostMount_diameter: float = 28 |
269 | 269 | SeatPostMount_length: float = 20 |
@@ -321,7 +321,7 @@ async def jobstate(websocket: WebSocket, uid: uuid.UUID): |
321 | 321 | for c in glob.glob(f"{temp / 'temp' / 'export'}/**/*.stl", recursive=True) |
322 | 322 | ] |
323 | 323 |
|
324 | | - progress = (len(completed) / (len(info['parts']) + 1)) |
| 324 | + progress = (len(completed) / (len(info['parts']))) |
325 | 325 |
|
326 | 326 | try: |
327 | 327 | await websocket.send_json({ |
|
0 commit comments