diff --git a/static/secrets.js b/static/secrets.js index e58c4c0..47b7aa9 100644 --- a/static/secrets.js +++ b/static/secrets.js @@ -461,7 +461,7 @@ }; // Ensure manual renew button uses the secretName from the closure - manualRenewBtn.onclick = () => manualRenewCertificate(secretName); + manualRenewBtn.onclick = () => manualRenewCertificate(secretName, domainInput.value); } catch (error) { @@ -496,10 +496,12 @@ * Calls the backend API to trigger an immediate manual certificate renewal. * NOTE: Updated to accept secretName as an argument or fallback to the element text. * @param {string} [secretNameArg] - The name of the secret/certificate to renew (optional). + * @param {string} domain - The domain name associated with the certificate. */ -export async function manualRenewCertificate(secretNameArg) { +export async function manualRenewCertificate(secretNameArg, domain) { // Prefer argument, fallback to element text if available const secretName = secretNameArg || document.getElementById("rotation-secret-name").textContent; + const donmainName = domain || document.getElementById('rotation-domain-input')?.value.trim() || ''; if (!secretName) { alert("Error: Could not determine the secret name for manual renewal."); return; @@ -507,7 +509,8 @@ const url = `${API_BASE_URL}/renew-certificate`; const payload = { - secret_name: secretName + secret_name: secretName, + domain: donmainName }; if (!confirm(`⚠️ WARNING: Are you sure you want to manually renew certificate for secret: ${secretName}? This will attempt to refresh the certificate immediately.`)) { return;