From d2703ff84bc542fe8a6555d636cc54e8d8965417 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 00:51:40 +0000 Subject: [PATCH 1/2] Initial plan From 0c3f74e7de96fec4214346fb0c7cdeb91a254637 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 00:55:08 +0000 Subject: [PATCH 2/2] Fix onboarding wizard: remove scroll boxes, fix footer spacing, add per-field save buttons Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/0b500e06-d8c5-4745-9768-29523ffc99c6 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- .../static/css/onboarding.css | 11 +-- app/sovran_systemsos_web/static/onboarding.js | 71 +++++++++++++++++++ .../templates/onboarding.html | 4 +- 3 files changed, 76 insertions(+), 10 deletions(-) diff --git a/app/sovran_systemsos_web/static/css/onboarding.css b/app/sovran_systemsos_web/static/css/onboarding.css index fe73b20..23cb8f3 100644 --- a/app/sovran_systemsos_web/static/css/onboarding.css +++ b/app/sovran_systemsos_web/static/css/onboarding.css @@ -146,13 +146,6 @@ gap: 16px; } -.onboarding-card--scroll { - max-height: 360px; - overflow-y: auto; - scrollbar-width: thin; - scrollbar-color: var(--border-color) transparent; -} - /* Body text */ .onboarding-body-text { @@ -224,7 +217,9 @@ display: flex; align-items: center; justify-content: space-between; - padding-top: 16px; + padding-top: 24px; + padding-bottom: 24px; + margin-top: auto; } .onboarding-btn-next { diff --git a/app/sovran_systemsos_web/static/onboarding.js b/app/sovran_systemsos_web/static/onboarding.js index 4821262..2b262d6 100644 --- a/app/sovran_systemsos_web/static/onboarding.js +++ b/app/sovran_systemsos_web/static/onboarding.js @@ -308,6 +308,8 @@ async function loadStep3() { html += ''; html += ''; html += '
ℹ Paste the curl URL from your Njal.la dashboard\'s Dynamic record
'; + html += ''; + html += ''; html += ''; }); } @@ -318,9 +320,78 @@ async function loadStep3() { html += ''; html += 'Let\'s Encrypt uses this for certificate expiry notifications.
'; html += ''; + html += ''; + html += ''; html += ''; body.innerHTML = html; + + // Wire per-field save buttons for domains + body.querySelectorAll('[data-save-domain]').forEach(function(btn) { + btn.addEventListener('click', async function() { + var domainName = btn.dataset.saveDomain; + var domainInput = document.getElementById('domain-input-' + domainName); + var ddnsInput = document.getElementById('ddns-input-' + domainName); + var statusEl = document.getElementById('domain-save-status-' + domainName); + var domainVal = domainInput ? domainInput.value.trim() : ''; + var ddnsVal = ddnsInput ? ddnsInput.value.trim() : ''; + + if (!domainVal) { + if (statusEl) { statusEl.textContent = '⚠ Enter a domain first'; statusEl.style.color = 'var(--red)'; } + return; + } + + btn.disabled = true; + btn.textContent = 'Saving…'; + if (statusEl) { statusEl.textContent = ''; } + + try { + await apiFetch('/api/domains/set', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ domain_name: domainName, domain: domainVal, ddns_url: ddnsVal }), + }); + if (statusEl) { statusEl.textContent = '✓ Saved'; statusEl.style.color = 'var(--green)'; } + } catch (err) { + if (statusEl) { statusEl.textContent = '⚠ ' + err.message; statusEl.style.color = 'var(--red)'; } + } + + btn.disabled = false; + btn.textContent = 'Save'; + }); + }); + + // Wire save button for SSL email + body.querySelectorAll('[data-save-email]').forEach(function(btn) { + btn.addEventListener('click', async function() { + var emailInput = document.getElementById('ssl-email-input'); + var statusEl = document.getElementById('domain-save-status-email'); + var emailVal = emailInput ? emailInput.value.trim() : ''; + + if (!emailVal) { + if (statusEl) { statusEl.textContent = '⚠ Enter an email first'; statusEl.style.color = 'var(--red)'; } + return; + } + + btn.disabled = true; + btn.textContent = 'Saving…'; + if (statusEl) { statusEl.textContent = ''; } + + try { + await apiFetch('/api/domains/set-email', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ email: emailVal }), + }); + if (statusEl) { statusEl.textContent = '✓ Saved'; statusEl.style.color = 'var(--green)'; } + } catch (err) { + if (statusEl) { statusEl.textContent = '⚠ ' + err.message; statusEl.style.color = 'var(--red)'; } + } + + btn.disabled = false; + btn.textContent = 'Save'; + }); + }); } async function saveStep3() { diff --git a/app/sovran_systemsos_web/templates/onboarding.html b/app/sovran_systemsos_web/templates/onboarding.html index b4701ec..f0d1427 100644 --- a/app/sovran_systemsos_web/templates/onboarding.html +++ b/app/sovran_systemsos_web/templates/onboarding.html @@ -105,7 +105,7 @@ Finally, paste the DDNS curl command from your Njal.la dashboard for each service below. -Loading service information…
Checking ports…