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) { - +