diff --git a/backend/app.py b/backend/app.py index 54b258c..2eb0b1c 100644 --- a/backend/app.py +++ b/backend/app.py @@ -282,7 +282,12 @@ app = FastAPI(title="Scheduler API", version="0.1.0", lifespan=lifespan) app.add_middleware( CORSMiddleware, - allow_origins=["http://localhost:5173", "http://127.0.0.1:5173"], + allow_origins=[ + "http://localhost:5173", + "http://127.0.0.1:5173", + "http://localhost:8080", + "http://127.0.0.1:8080", + ], allow_methods=["*"], allow_headers=["*"], ) @@ -307,9 +312,22 @@ def get_settings() -> dict[str, Any]: @app.post("/api/tests/load") def load_tests(request: LoadTestsRequest) -> dict[str, Any]: - csv_path = Path(request.csv_path) - if not csv_path.is_absolute(): - csv_path = APP_ROOT / csv_path + received_path = request.csv_path + + # Handle absolute paths (Windows or Unix) by extracting just the filename + if "\\" in received_path or ":" in received_path or received_path.startswith("/"): + # Absolute path (Windows with backslash or drive letter, or Unix with /) + # Extract just the filename from the path + filename = received_path.replace("\\", "/").split("/")[-1] + + data_dir_path = APP_ROOT / "data" / filename + if data_dir_path.exists(): + csv_path = data_dir_path + else: + csv_path = APP_ROOT / filename + else: + # Relative paths - prepend APP_ROOT + csv_path = APP_ROOT / received_path settings = db.read_settings(DB_PATH) smb_credentials = _smb_credentials_from_settings(settings) diff --git a/frontend/src/components/SettingsModal.jsx b/frontend/src/components/SettingsModal.jsx index 924fb71..a4b3dae 100644 --- a/frontend/src/components/SettingsModal.jsx +++ b/frontend/src/components/SettingsModal.jsx @@ -35,14 +35,9 @@ export default function SettingsModal({ isOpen, onClose, settings, onSave }) { onClose() } - function handleBackdropClick(e) { - if (e.target === e.currentTarget) onClose() - } - return (
{/* Modal header */}