diff --git a/app/sovran_systemsos_web/static/js/helpers.js b/app/sovran_systemsos_web/static/js/helpers.js index 120a1e1..bfeb702 100644 --- a/app/sovran_systemsos_web/static/js/helpers.js +++ b/app/sovran_systemsos_web/static/js/helpers.js @@ -63,6 +63,10 @@ async function apiFetch(path, options) { } else if (body.detail && typeof body.detail.message === "string") { detail = body.detail.message; } + } else if (body && typeof body.message === "string") { + detail = body.message; + } else if (body && typeof body.error === "string") { + detail = body.error; } } catch (e) {} throw new Error(detail); diff --git a/app/sovran_systemsos_web/static/js/service-detail.js b/app/sovran_systemsos_web/static/js/service-detail.js index 5022a6a..7ff9b91 100644 --- a/app/sovran_systemsos_web/static/js/service-detail.js +++ b/app/sovran_systemsos_web/static/js/service-detail.js @@ -60,6 +60,13 @@ function _attachCopyHandlers(container) { var _nwcModalState = null; +function _isNwcServiceUnit(unit) { + // The dashboard tile is backed by Alby Hub, while older drafts referred to + // the logical feature as nwc-wallets.service. Support both so the Wallet + // Connections manager appears from the actual tile and any legacy configs. + return unit === "albyhub.service" || unit === "nwc-wallets.service"; +} + function _nwcStateMessageHtml() { if (!_nwcModalState || !_nwcModalState.message) return ""; var msgClass = _nwcModalState.messageKind === "success" ? "success" : "error"; @@ -171,14 +178,15 @@ function _nwcRenderWalletState() { return; } + var canCreate = !!state.domain && !state.busy; html += '
' + - '' + + '' + '' + '
'; if (state.domain) { html += '

Lightning Address domain: ' + escHtml(state.domain) + '

'; } else { - html += '

Lightning Address domain is not configured yet. Configure your domain first, then create wallet connections.

'; + html += '
Domain required
Configure the Lightning Address domain in the Domain Diagnostic Checklist above before creating Wallet Connections. Use a unique hostname such as lightning.yourdomain.com.
'; } if (!state.wallets || state.wallets.length === 0) { @@ -595,11 +603,16 @@ async function openServiceDetailModal(unit, name, icon) { } // Section E: Credentials & Links - if (unit === "nwc-wallets.service") { + if (_isNwcServiceUnit(unit)) { html += '
' + - '
Wallet Connections
' + - '

Loading wallet connections…

' + - '
'; + '
Wallet Connections
'; + if (effectiveEnabled || data.enabled) { + html += '

Create, verify, drain, and delete isolated NWC wallet connections without leaving the Hub.

' + + '

Loading wallet connections…

'; + } else { + html += '

Wallet Connections is disabled. Enable this feature below, rebuild, then return here to create and manage NWC wallet connections.

'; + } + html += ''; } else if (data.has_credentials && data.credentials && data.credentials.length > 0) { html += '
' + '
Credentials & Access
' + @@ -681,7 +694,7 @@ async function openServiceDetailModal(unit, name, icon) { $credsBody.innerHTML = html; _attachCopyHandlers($credsBody); - if (unit === "nwc-wallets.service") { + if (_isNwcServiceUnit(unit) && (effectiveEnabled || data.enabled)) { await _nwcInitWalletFlow(unit, name, icon); }