From 4638763ee1ef74dcf137493d68a57f928a68f236 Mon Sep 17 00:00:00 2001 From: Chaim Marcus Date: Thu, 26 Mar 2026 06:50:35 +0000 Subject: [PATCH] feat: structured extensions table in customer detail view 4 columns: name, installed version, available update, actions Actions: install (if not installed), update + remove (if installed) --- dashboard/src/App.jsx | 81 ++++++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 21 deletions(-) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 2344d4d..d148bc2 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -161,6 +161,11 @@ function CustomerDetail({ customerId }) { setDeploying(null) } + const remove = async (extId) => { + await fetch(`${API}/customers/${customerId}/extensions/${extId}`, { method: 'DELETE' }) + reload() + } + const assign = async (extId) => { await fetch(`${API}/customers/${customerId}/extensions`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -180,27 +185,61 @@ function CustomerDetail({ customerId }) { )} -
- {(customer.extensions || []).map(e => ( -
-
- {e.name} - - {e.installed_version ? `v${e.installed_version}` : 'לא מותקן'} - - {e.installed_version && e.latest_version && e.installed_version !== e.latest_version && ( - - עדכון: v{e.latest_version} - - )} -
- -
- ))} +
+ + + + + + + + + + + {(customer.extensions || []).map(e => { + const installed = e.installed_version + const hasUpdate = installed && e.latest_version && installed !== e.latest_version + return ( + + + + + + + ) + })} + +
שם ההרחבהמותקנתעדכון זמיןפעולות
{e.name} + {installed + ? v{installed} + : לא מותקן} + + {hasUpdate + ? v{e.latest_version} + : } + +
+ {!installed ? ( + + ) : ( + <> + + + + )} +
+
{available.length > 0 && (