diff --git a/src/services/wizard/index.ts b/src/services/wizard/index.ts index ad1c991d..f28095c3 100644 --- a/src/services/wizard/index.ts +++ b/src/services/wizard/index.ts @@ -63,11 +63,11 @@ export class Wizard { http_url: this.settings.serviceUrl, lnd_state: lndState, nprofile: this.nprofile, - provider_name: appNamesList, + provider_name: defaultApp?.name || appNamesList, relay_connected: this.adminManager.GetNostrConnected(), relays: this.relays, watchdog_ok: watchdogOk, - source_name: this.settings.defaultAppName || appNamesList, + source_name: defaultApp?.name || this.settings.defaultAppName || appNamesList, relay_url: relayUrl, automate_liquidity: this.settings.liquiditySettings.liquidityProviderPub !== 'null', push_backups_to_nostr: this.settings.pushBackupsToNostr, diff --git a/static/connect.html b/static/connect.html index 2b4eab16..11251b85 100644 --- a/static/connect.html +++ b/static/connect.html @@ -19,7 +19,7 @@
Lightning Pub logo - Lightning Pub logo + Lightning Pub logo
@@ -48,7 +48,7 @@
Click to reveal
-
+
@@ -104,13 +104,20 @@ height: 157, // correctLevel : QRCode.CorrectLevel.H }); - document.getElementById('connectString').innerHTML = connectString + document.getElementById('connectString').innerText = connectString } } try { fetchInfo() } catch (e) { console.log({ e }) } + // Continue to status + const btn = document.createElement('button') + btn.className = 'push-button' + btn.style.marginTop = '20px' + btn.innerText = 'Continue' + btn.onclick = () => { location.href = 'status.html' } + document.querySelector('.setup-content').appendChild(btn) diff --git a/static/img/xLightningPub.png b/static/img/xLightningPub.png deleted file mode 100644 index 1cbc35de..00000000 Binary files a/static/img/xLightningPub.png and /dev/null differ diff --git a/static/index.html b/static/index.html index 31144cd4..5daf5121 100644 --- a/static/index.html +++ b/static/index.html @@ -10,6 +10,8 @@ + + Lightning.Pub @@ -171,6 +173,156 @@ + + + +
+ + diff --git a/static/js/wizard.js b/static/js/wizard.js index fdc6f4ae..c52d82b7 100644 --- a/static/js/wizard.js +++ b/static/js/wizard.js @@ -20,6 +20,7 @@ $(() => { // Buttons const toLiquidityBtn = $("#liquidityBtn"); const toBackupBtn = $("#backupBtn"); + const toStatusBtn = $("#to-status"); const finishBtn = $("#next-button"); const backToNodeBtn = $("#back-to-node"); const backToLiquidityBtn = $("#back-to-liquidity"); @@ -95,12 +96,35 @@ $(() => { const j = await res.json(); throw new Error(j.reason || "Failed to start service"); } - location.href = 'connect.html'; + // Move to in-page connect step + showPage(pages.connect || $('#page-connect')); + // fetch and render connect info (re-using logic from connect.html) + (async () => { + const res = await fetch('/wizard/admin_connect_info'); + if (res.status !== 200) return; + const j = await res.json(); + if (j.connect_info && j.connect_info.enrolled_npub) { + showPage(pages.status || $('#page-status')) + return + } + const connectString = j.nprofile + ':' + j.connect_info.admin_token + const qrElement = document.getElementById('qrcode') + if (qrElement && !qrElement.firstChild) { + new QRCode(qrElement, { text: connectString, colorDark: '#000000', colorLight: '#ffffff', width: 157, height: 157 }); + } + const cs = document.getElementById('connectString'); + if (cs) cs.innerText = connectString + })(); } catch (err) { errorTextBackup.text(err.message); } }); + // Navigate from connect to status + toStatusBtn && toStatusBtn.click(() => { + showPage(pages.status || $('#page-status')) + }) + const syncRelayState = () => { relayUrlInput.prop('disabled', customCheckbox.prop('checked')); if (customCheckbox.prop('checked')) {