fix(dashboard): VWB import URL dynamique pour éviter hardcoded localhost

- 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 <qwen-coder@alibabacloud.com>
This commit is contained in:
Dom
2026-06-15 18:13:22 +02:00
parent cbd3d40e39
commit c12fd8e1c1

View File

@@ -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([