From c12fd8e1c1d421e20942e44321e1c3b05891c933 Mon Sep 17 00:00:00 2001 From: Dom Date: Mon, 15 Jun 2026 18:13:22 +0200 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20VWB=20import=20URL=20dynamiqu?= =?UTF-8?q?e=20pour=20=C3=A9viter=20hardcoded=20localhost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remplace l'URL hardcodée 'http://localhost:5002' par une construction dynamique basée sur l'origine actuelle. - Permet les tests d'import depuis la VM ou le poste de test via l'IP du banc (ex: 192.168.1.45) sans échec CORS/routage. - Respecte la règle POC DGX : pas de localhost comme preuve produit. Co-authored-by: Qwen-Coder --- web_dashboard/templates/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web_dashboard/templates/index.html b/web_dashboard/templates/index.html index 304e6d0f6..970970209 100644 --- a/web_dashboard/templates/index.html +++ b/web_dashboard/templates/index.html @@ -2800,7 +2800,10 @@ // Utiliser le proxy du dashboard pour éviter les problèmes CORS const STREAMING_BASE = '/api/streaming'; - const VWB_IMPORT_URL = 'http://localhost:5002/api/workflows/import-core'; + // Construire VWB_IMPORT_URL dynamiquement à partir de l'origine actuelle (ex: http://192.168.1.45:5001 -> http://192.168.1.45:5002) + // pour éviter le hardcoded localhost et permettre les tests depuis la VM/poste via l'IP du banc. + const VWB_BASE = window.location.origin.replace(/:\d+$/, ':5002'); + const VWB_IMPORT_URL = `${VWB_BASE}/api/workflows/import-core`; async function refreshStreaming() { await Promise.all([