From 40595fc38197a98d3c07b222f799197b8c15d4b6 Mon Sep 17 00:00:00 2001 From: twothatIT Date: Tue, 10 Mar 2026 22:08:17 +0100 Subject: [PATCH] fix(deploy): show customer name in redeploy modal instead of ID The modal was showing '#2' instead of the customer name when opened from the customer detail view, because the dashboard table row was not visible. Now the name is passed directly from the button's onclick context where data.name is already available. Co-Authored-By: Claude Sonnet 4.6 --- static/js/app.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index bd1405f..e666504 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -669,9 +669,9 @@ async function confirmDeleteCustomer() { // --------------------------------------------------------------------------- // Customer Actions (start/stop/restart/deploy) // --------------------------------------------------------------------------- -async function customerAction(id, action) { +async function customerAction(id, action, name) { if (action === 'deploy') { - showRedeployModal(id); + showRedeployModal(id, name); return; } try { @@ -683,9 +683,12 @@ async function customerAction(id, action) { } } -function showRedeployModal(id) { - const row = document.querySelector(`tr[data-customer-id="${id}"]`); - const name = row ? row.querySelector('td')?.textContent?.trim() : `#${id}`; +function showRedeployModal(id, name) { + // Prefer passed name, fallback to dashboard table row, then ID + if (!name) { + const row = document.querySelector(`tr[data-customer-id="${id}"]`); + name = row ? row.querySelector('td')?.textContent?.trim() : `#${id}`; + } document.getElementById('redeploy-customer-id').value = id; document.getElementById('redeploy-customer-name').textContent = name; new bootstrap.Modal(document.getElementById('redeploy-modal')).show(); @@ -786,7 +789,7 @@ async function viewCustomer(id) { - +