{!isRunning ? (
-
+
+
+
+
) : (
<>
diff --git a/visual_workflow_builder/frontend_v4/src/services/uiDetection.ts b/visual_workflow_builder/frontend_v4/src/services/uiDetection.ts
index 587610be4..ba474abd9 100644
--- a/visual_workflow_builder/frontend_v4/src/services/uiDetection.ts
+++ b/visual_workflow_builder/frontend_v4/src/services/uiDetection.ts
@@ -2,8 +2,8 @@
* Service de détection UI (UI-DETR-1)
*/
-// VWB backend (port 5002) — contient le screen capturer et la détection UI
-const API_BASE = `http://${window.location.hostname}:5002`;
+// Via le proxy Vite (/api → port 5002) — fonctionne depuis n'importe quel navigateur
+const API_BASE = '';
export interface UIElement {
id: number;
@@ -52,7 +52,8 @@ export async function detectUIElements(
'Content-Type': 'application/json',
},
body: JSON.stringify({
- image_base64: imageBase64,
+ // Enlever le préfixe data:image/...;base64, si présent
+ image_base64: imageBase64.replace(/^data:image\/[^;]+;base64,/, ''),
threshold: options.threshold ?? 0.35,
annotate: options.annotate ?? false,
show_confidence: options.showConfidence ?? false,