From f8026afed4506625a2a037e60b5946d9ab69de2e Mon Sep 17 00:00:00 2001 From: Chaim Date: Mon, 30 Mar 2026 21:00:43 +0000 Subject: [PATCH] fix: improved error display - show step, HTTP code, Hebrew messages; sync errors shown to user; deployment log shows error details --- dashboard/src/App.jsx | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index cc75da5..85ea2ae 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -259,11 +259,18 @@ function CustomerDetail({ customerId, onDelete }) { setSyncing(true) setDeployResult(null) try { - await fetch('/sync', { + const r = await fetch('/sync', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ customer_id: customerId }) }) - } catch (_) {} + const result = await r.json() + const custResult = result.results?.find(r => r.customer_id === customerId || r.status === 'error') + if (custResult?.status === 'error') { + setDeployResult({ module: 'סנכרון', status: 'error', message: custResult.message }) + } + } catch (e) { + setDeployResult({ module: 'סנכרון', status: 'error', message: `שגיאת רשת: ${e.message}` }) + } reload() setSyncing(false) } @@ -393,9 +400,18 @@ function CustomerDetail({ customerId, onDelete }) { )} {deployResult && ( -
- - {deployResult.module}: {deployResult.status === 'ok' ? 'הותקן בהצלחה!' : `שגיאה: ${deployResult.message}`} +
+
+ + {deployResult.module}: {deployResult.status === 'ok' ? 'הותקן בהצלחה!' : 'נכשל'} +
+ {deployResult.status !== 'ok' && deployResult.message && ( +
+
{deployResult.message}
+ {deployResult.step &&
שלב: {({find_release:'חיפוש גרסה',find_zip:'חיפוש קובץ ZIP',download_zip:'הורדת ZIP',upload:'העלאה ל-EspoCRM',install:'התקנה',rebuild:'בנייה מחדש'})[deployResult.step] || deployResult.step}
} + {deployResult.code &&
קוד שגיאה: {deployResult.code}{deployResult.code === 401 ? ' (שם משתמש/סיסמה שגויים)' : deployResult.code === 403 ? ' (אין הרשאה)' : deployResult.code === 404 ? ' (לא נמצא)' : deployResult.code === 500 ? ' (שגיאת שרת)' : ''}
} +
+ )}
)} @@ -553,10 +569,13 @@ function DeploymentsTab() { {d.version} - + {d.status === 'ok' ? 'הצלחה' : 'שגיאה'} + {d.status !== 'ok' && d.error_message && ( +
{d.error_message}
+ )}