diff --git a/installer/registry.jsonl b/installer/registry.jsonl index 4350473..dff2dce 100644 --- a/installer/registry.jsonl +++ b/installer/registry.jsonl @@ -20,3 +20,4 @@ {"ts":"2026-05-03T18:17:28Z","session":"20260503-051453_mva154_nginx-enduro-location_3cee","host":"mva154","status":"success","agent":"stream","files":["/etc/nginx/sites-enabled/openclaw.mva154.duckdns.org"]} {"ts":"2026-05-04T08:32:10Z","action":"cleanup","deleted_orphaned_sessions":0,"deleted_logs":0,"retention_days":30} {"ts":"2026-05-04T08:37:04Z","session":"20260504-083250_mva154_enduro-phase3-bugfix_d0a2","host":"mva154","status":"success","agent":"dev","files":["/home/slin/enduro-trails/prototype/app.py","/home/slin/enduro-trails/prototype/static/app.js"]} +{"ts":"2026-05-04T09:24:59Z","action":"cleanup","deleted_orphaned_sessions":0,"deleted_logs":0,"retention_days":30} diff --git a/tasks/enduro-trails/prototype/app.py b/tasks/enduro-trails/prototype/app.py index 8edec22..61d69a1 100644 --- a/tasks/enduro-trails/prototype/app.py +++ b/tasks/enduro-trails/prototype/app.py @@ -485,9 +485,13 @@ async def post_route(req: RouteRequest): coords_str = ";".join(f"{wp.lon},{wp.lat}" for wp in req.waypoints) alternatives = max(1, min(5, req.alternatives)) + # Увеличенный snap radius для длинных маршрутов (5 км) + radiuses_str = ";".join(["5000"] * len(req.waypoints)) + url = ( f"{OSRM_URL}/route/v1/driving/{coords_str}" f"?alternatives={alternatives}&overview=full&geometries=geojson&annotations=false" + f"&radiuses={radiuses_str}" ) try: @@ -525,7 +529,16 @@ async def post_route(req: RouteRequest): raise HTTPException(503, f"OSRM недоступен: {e}") if data.get("code") != "Ok" or not data.get("routes"): - raise HTTPException(404, "Маршрут не найден") + osrm_code = data.get("code", "Unknown") + osrm_msg = data.get("message", "") + if osrm_code == "NoRoute": + raise HTTPException(404, "Маршрут не найден: нет пути между точками") + elif osrm_code == "NoSegment": + raise HTTPException(404, "Маршрут не найден: точки слишком далеко от дорог") + elif osrm_code == "InvalidValue": + raise HTTPException(400, f"Некорректные координаты: {osrm_msg}") + else: + raise HTTPException(404, f"Маршрут не найден ({osrm_code})") # Открываем БД один раз для всех маршрутов try: diff --git a/tasks/enduro-trails/prototype/static/app.css b/tasks/enduro-trails/prototype/static/app.css index 008667d..f5c6d20 100644 --- a/tasks/enduro-trails/prototype/static/app.css +++ b/tasks/enduro-trails/prototype/static/app.css @@ -226,6 +226,21 @@ body { bottom: 40px; } +/* ─── Панель маршрута — не перекрывать кнопки управления ─────────────────── */ +#route-panel { + right: 56px !important; /* кнопки 36px + gap 10px + отступ 10px */ +} + +@media (max-width: 768px) { + #route-panel { + right: 8px !important; + left: 8px !important; + width: auto !important; + bottom: 100px !important; /* выше кнопок на мобиле */ + max-height: 50vh; + } +} + .map-ctrl-btn { width: 36px; height: 36px; diff --git a/tasks/enduro-trails/prototype/static/index.html b/tasks/enduro-trails/prototype/static/index.html index 531e3e0..f4efbf1 100644 --- a/tasks/enduro-trails/prototype/static/index.html +++ b/tasks/enduro-trails/prototype/static/index.html @@ -95,7 +95,7 @@