From fa22a080b9fd4037d7dd9895edbcf92a98c08fba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 00:37:40 +0000 Subject: [PATCH] fix: replace broken Feature Manager references with Configure Domain button - server.py: add domain_name to /api/service-detail response - service-detail.js: replace both Feature Manager references with Configure Domain / Reconfigure Domain buttons with click handlers - tiles.css: add .svc-detail-domain-btn class for button spacing Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/ae38c98e-28bb-4d1e-8dae-78ebde64ad44 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- app/sovran_systemsos_web/server.py | 1 + app/sovran_systemsos_web/static/css/tiles.css | 6 +++++ .../static/js/service-detail.js | 26 ++++++++++++++++--- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/sovran_systemsos_web/server.py b/app/sovran_systemsos_web/server.py index 747df5c..30a287c 100644 --- a/app/sovran_systemsos_web/server.py +++ b/app/sovran_systemsos_web/server.py @@ -2162,6 +2162,7 @@ async def api_service_detail(unit: str, icon: str | None = None): "credentials": resolved_creds, "needs_domain": needs_domain, "domain": domain, + "domain_name": domain_key, "domain_status": domain_status, "port_requirements": port_requirements, "port_statuses": port_statuses, diff --git a/app/sovran_systemsos_web/static/css/tiles.css b/app/sovran_systemsos_web/static/css/tiles.css index 9acd4c7..5d7346e 100644 --- a/app/sovran_systemsos_web/static/css/tiles.css +++ b/app/sovran_systemsos_web/static/css/tiles.css @@ -310,6 +310,12 @@ text-decoration: underline; } +/* ── Service detail: Domain configure button ─────────────────────── */ + +.svc-detail-domain-btn { + margin-top: 12px; +} + /* ── Service detail: Addon feature toggle ────────────────────────── */ .svc-detail-addon-row { diff --git a/app/sovran_systemsos_web/static/js/service-detail.js b/app/sovran_systemsos_web/static/js/service-detail.js index 0708870..0d9b10c 100644 --- a/app/sovran_systemsos_web/static/js/service-detail.js +++ b/app/sovran_systemsos_web/static/js/service-detail.js @@ -244,8 +244,8 @@ async function openServiceDetailModal(unit, name, icon) { '
  • Find the domain you purchased for this service
  • ' + '
  • Create a Dynamic DNS record pointing to your external IP: ' + escHtml(ds.expected_ip || "—") + '
  • ' + '
  • Copy the DDNS curl command from Njal.la\'s dashboard
  • ' + - '
  • You can re-enter it in the Feature Manager to update your configuration
  • ' + '' + + '' + ''; } else { domainBadge = '' + escHtml(data.domain) + ''; @@ -257,9 +257,9 @@ async function openServiceDetailModal(unit, name, icon) { '

    To get this service working:

    ' + '
      ' + '
    1. Purchase a subdomain at njal.la (if you haven\'t already)
    2. ' + - '
    3. Go to the Feature Manager in the sidebar
    4. ' + - '
    5. Find this service and configure your domain through the setup wizard
    6. ' + + '
    7. Use the button below to configure your domain through the setup wizard
    8. ' + '
    ' + + '' + ''; } @@ -385,6 +385,26 @@ async function openServiceDetailModal(unit, name, icon) { }); } } + + // Configure Domain button (for non-feature services that need a domain) + var configDomainBtn = document.getElementById("svc-detail-config-domain-btn"); + var reconfigDomainBtn = document.getElementById("svc-detail-reconfig-domain-btn"); + var domainBtn = configDomainBtn || reconfigDomainBtn; + if (domainBtn && data.needs_domain && data.domain_name) { + var pseudoFeat = { + id: data.domain_name, + name: name, + domain_name: data.domain_name, + needs_ddns: true, + extra_fields: [] + }; + domainBtn.addEventListener("click", function() { + closeCredsModal(); + openDomainSetupModal(pseudoFeat, function() { + openServiceDetailModal(unit, name, icon); + }); + }); + } } catch (err) { if ($credsBody) $credsBody.innerHTML = '

    Could not load service details.

    '; }