Compare commits
3 Commits
cd4df316ae
...
02b4e6b5b4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02b4e6b5b4 | ||
|
|
fa22a080b9 | ||
|
|
70f0af98f6 |
@@ -2162,6 +2162,7 @@ async def api_service_detail(unit: str, icon: str | None = None):
|
|||||||
"credentials": resolved_creds,
|
"credentials": resolved_creds,
|
||||||
"needs_domain": needs_domain,
|
"needs_domain": needs_domain,
|
||||||
"domain": domain,
|
"domain": domain,
|
||||||
|
"domain_name": domain_key,
|
||||||
"domain_status": domain_status,
|
"domain_status": domain_status,
|
||||||
"port_requirements": port_requirements,
|
"port_requirements": port_requirements,
|
||||||
"port_statuses": port_statuses,
|
"port_statuses": port_statuses,
|
||||||
|
|||||||
@@ -310,6 +310,12 @@
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ── Service detail: Domain configure button ─────────────────────── */
|
||||||
|
|
||||||
|
.svc-detail-domain-btn {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
/* ── Service detail: Addon feature toggle ────────────────────────── */
|
/* ── Service detail: Addon feature toggle ────────────────────────── */
|
||||||
|
|
||||||
.svc-detail-addon-row {
|
.svc-detail-addon-row {
|
||||||
|
|||||||
@@ -244,8 +244,8 @@ async function openServiceDetailModal(unit, name, icon) {
|
|||||||
'<li>Find the domain you purchased for this service</li>' +
|
'<li>Find the domain you purchased for this service</li>' +
|
||||||
'<li>Create a Dynamic DNS record pointing to your external IP: <code>' + escHtml(ds.expected_ip || "—") + '</code></li>' +
|
'<li>Create a Dynamic DNS record pointing to your external IP: <code>' + escHtml(ds.expected_ip || "—") + '</code></li>' +
|
||||||
'<li>Copy the DDNS curl command from Njal.la\'s dashboard</li>' +
|
'<li>Copy the DDNS curl command from Njal.la\'s dashboard</li>' +
|
||||||
'<li>You can re-enter it in the Feature Manager to update your configuration</li>' +
|
|
||||||
'</ol>' +
|
'</ol>' +
|
||||||
|
'<button class="btn btn-primary svc-detail-domain-btn" id="svc-detail-reconfig-domain-btn">🔄 Reconfigure Domain</button>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
} else {
|
} else {
|
||||||
domainBadge = '<span class="svc-detail-domain-value">' + escHtml(data.domain) + '</span>';
|
domainBadge = '<span class="svc-detail-domain-value">' + escHtml(data.domain) + '</span>';
|
||||||
@@ -257,9 +257,9 @@ async function openServiceDetailModal(unit, name, icon) {
|
|||||||
'<p style="margin-top:8px">To get this service working:</p>' +
|
'<p style="margin-top:8px">To get this service working:</p>' +
|
||||||
'<ol>' +
|
'<ol>' +
|
||||||
'<li>Purchase a subdomain at <a href="https://njal.la" target="_blank">njal.la</a> (if you haven\'t already)</li>' +
|
'<li>Purchase a subdomain at <a href="https://njal.la" target="_blank">njal.la</a> (if you haven\'t already)</li>' +
|
||||||
'<li>Go to the <strong>Feature Manager</strong> in the sidebar</li>' +
|
'<li>Use the button below to configure your domain through the setup wizard</li>' +
|
||||||
'<li>Find this service and configure your domain through the setup wizard</li>' +
|
|
||||||
'</ol>' +
|
'</ol>' +
|
||||||
|
'<button class="btn btn-primary svc-detail-domain-btn" id="svc-detail-config-domain-btn">🌐 Configure Domain</button>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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) {
|
} catch (err) {
|
||||||
if ($credsBody) $credsBody.innerHTML = '<p class="creds-empty">Could not load service details.</p>';
|
if ($credsBody) $credsBody.innerHTML = '<p class="creds-empty">Could not load service details.</p>';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user