From 6b2d7aefbb9ab7a6a2c40aa021f6df4407a0af11 Mon Sep 17 00:00:00 2001 From: Floke Date: Tue, 24 Feb 2026 08:40:38 +0000 Subject: [PATCH] =?UTF-8?q?[31188f42]=20einf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit einfügen --- .dev_session/SESSION_INFO | 2 +- company-explorer/backend/app.py | 28 +++- company-explorer/frontend/src/App.tsx | 12 +- connector-superoffice/README.md | 22 ++- connector-superoffice/queue_manager.py | 126 ++++++++++++++- connector-superoffice/webhook_app.py | 212 +++++++++++++++++++------ connector-superoffice/worker.py | 4 +- debug_paths.py | 13 ++ nginx-proxy.conf | 7 - 9 files changed, 361 insertions(+), 65 deletions(-) create mode 100644 debug_paths.py diff --git a/.dev_session/SESSION_INFO b/.dev_session/SESSION_INFO index fc2c992c..b8b2af6d 100644 --- a/.dev_session/SESSION_INFO +++ b/.dev_session/SESSION_INFO @@ -1 +1 @@ -{"task_id": "2ff88f42-8544-8050-8245-c3bb852058f4", "token": "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", "session_start_time": "2026-02-24T07:13:35.422817"} \ No newline at end of file +{"task_id": "31188f42-8544-806d-bd3c-e45991a3e8c8", "token": "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", "session_start_time": "2026-02-24T08:40:20.490166"} \ No newline at end of file diff --git a/company-explorer/backend/app.py b/company-explorer/backend/app.py index a09cff67..1d2dce2b 100644 --- a/company-explorer/backend/app.py +++ b/company-explorer/backend/app.py @@ -1252,7 +1252,6 @@ def run_batch_classification_task(): # --- Serve Frontend --- static_path = "/frontend_static" if not os.path.exists(static_path): - # Local dev fallback static_path = os.path.join(os.path.dirname(__file__), "../../frontend/dist") if not os.path.exists(static_path): static_path = os.path.join(os.path.dirname(__file__), "../static") @@ -1260,11 +1259,34 @@ if not os.path.exists(static_path): logger.info(f"Static files path: {static_path} (Exists: {os.path.exists(static_path)})") if os.path.exists(static_path): + from fastapi.responses import FileResponse + from fastapi.staticfiles import StaticFiles + + index_file = os.path.join(static_path, "index.html") + + # Mount assets specifically first + assets_path = os.path.join(static_path, "assets") + if os.path.exists(assets_path): + app.mount("/assets", StaticFiles(directory=assets_path), name="assets") + @app.get("/") async def serve_index(): - return FileResponse(os.path.join(static_path, "index.html")) + return FileResponse(index_file) - app.mount("/", StaticFiles(directory=static_path, html=True), name="static") + # Catch-all for SPA routing (any path not matched by API or assets) + @app.get("/{full_path:path}") + async def spa_fallback(full_path: str): + # Allow API calls to fail naturally with 404 + if full_path.startswith("api/"): + raise HTTPException(status_code=404) + + # If it's a file that exists, serve it (e.g. favicon, robots.txt) + file_path = os.path.join(static_path, full_path) + if os.path.isfile(file_path): + return FileResponse(file_path) + + # Otherwise, serve index.html for SPA routing + return FileResponse(index_file) else: @app.get("/") def root_no_frontend(): diff --git a/company-explorer/frontend/src/App.tsx b/company-explorer/frontend/src/App.tsx index ef901cea..d2e694a2 100644 --- a/company-explorer/frontend/src/App.tsx +++ b/company-explorer/frontend/src/App.tsx @@ -4,7 +4,7 @@ import { ContactsTable } from './components/ContactsTable' // NEW import { ImportWizard } from './components/ImportWizard' import { Inspector } from './components/Inspector' import { RoboticsSettings } from './components/RoboticsSettings' -import { LayoutDashboard, UploadCloud, RefreshCw, Settings, Users, Building, Sun, Moon } from 'lucide-react' +import { LayoutDashboard, UploadCloud, RefreshCw, Settings, Users, Building, Sun, Moon, Activity } from 'lucide-react' import clsx from 'clsx' // Base URL detection (Production vs Dev) @@ -119,6 +119,16 @@ function App() { {theme === 'dark' ? : } + + + +