fix(server): update path configuration for asset directories

This commit is contained in:
yexiaozhou
2026-04-01 22:07:44 +08:00
parent 9ef24b7768
commit 6e1b26a754

View File

@@ -42,18 +42,18 @@ logger = logging.getLogger(__name__)
STATIC_DIR = Path(__file__).parent / "static" STATIC_DIR = Path(__file__).parent / "static"
# 可配置路径 # 可配置路径
# LeapLab 仓库根目录(layout_optimizer 的父目录) # __file__ -> Uni-Lab-OS/unilabos/layout_optimizer/server.py
_REPO_ROOT = Path(__file__).resolve().parent.parent _UNILABOS_DIR = Path(__file__).resolve().parent.parent # .../Uni-Lab-OS/unilabos/
UNI_LAB_ASSETS_DIR = Path( UNI_LAB_ASSETS_DIR = Path(
os.getenv("UNI_LAB_ASSETS_DIR", str(_REPO_ROOT.parent / "uni-lab-assets")) os.getenv("UNI_LAB_ASSETS_DIR", str(_UNILABOS_DIR.parent.parent.parent / "uni-lab-assets"))
) )
UNI_LAB_ASSETS_MODELS_DIR = UNI_LAB_ASSETS_DIR / "device_models" UNI_LAB_ASSETS_MODELS_DIR = UNI_LAB_ASSETS_DIR / "device_models"
UNI_LAB_ASSETS_DATA_JSON = UNI_LAB_ASSETS_DIR / "data.json" UNI_LAB_ASSETS_DATA_JSON = UNI_LAB_ASSETS_DIR / "data.json"
UNI_LAB_OS_DEVICE_MESH_DIR = Path( UNI_LAB_OS_DEVICE_MESH_DIR = Path(
os.getenv( os.getenv(
"UNI_LAB_OS_DEVICE_MESH_DIR", "UNI_LAB_OS_DEVICE_MESH_DIR",
str(_REPO_ROOT / "Uni-Lab-OS" / "unilabos" / "device_mesh" / "devices"), str(_UNILABOS_DIR / "device_mesh" / "devices"),
) )
) )