On a domain, show the code and nothing else

Build 123. 122 taught the banner and the QR about the public address but left
the interface picker underneath them untouched, so the panel still listed
10.6.5.55 and 10.1.7.39 with one marked IN USE — numbers that no longer point
anywhere anybody is being sent, directly under a banner naming the domain.

Those rows exist to choose which interface the code encodes, which is a
question only a LAN setup has: with a public address set the code points at the
domain whichever row is picked. They are hidden now, and a LAN-only campus is
unaffected.

Printable poster is replaced by Save QR image. The poster people actually print
is made in their own design tool, and what they need from the app is the code
as a file — a 512px SVG, so it scales to any size without going soft. The
built-in poster page is untouched at /poster for anyone who wants it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Waters Church
2026-10-15 13:48:18 -04:00
co-authored by Claude Opus 5
parent 817fb743de
commit 826c471ed7
3 changed files with 39 additions and 5 deletions
+36 -2
View File
@@ -3602,6 +3602,26 @@ function renderShare() {
const list = state.local.addresses || [];
const box = $('addrList');
box.textContent = '';
/*
* WHICH INTERFACE THE QR USES IS A QUESTION ONLY A LAN SETUP HAS.
*
* These rows let the operator pick the address the code points at. Once a
* public address is configured the code points at the domain whatever they
* pick, so the list is a row of numbers that do nothing — and the one
* marked IN USE is not the address anyone is being given. Hide it.
*/
const addrBox = $('addrList');
addrBox.hidden = !!publicBaseConfigured();
if (addrBox.hidden) {
/* Still draw the code itself — it is the only thing left in this panel. */
const only = shareBase();
$('qr').src = only
? 'http://127.0.0.1:' + state.local.port + '/qr.svg?url=' + encodeURIComponent(only + '/')
: '';
renderQrWarning();
renderOperatorUrl();
return;
}
/* Mark the row the QR is actually using, not the row that was saved — when
a lease moves those are two different things and the saved one is gone. */
@@ -3643,8 +3663,22 @@ $('copyAddr').addEventListener('click', () => {
.catch((err) => log('could not copy: ' + err.message, 'err'));
});
$('openPoster').addEventListener('click', () => {
window.open('http://127.0.0.1:' + state.local.port + '/poster', '_blank');
/*
* The QR itself, saved as a file, because the poster people actually print
* is made in their own design tool. The built-in poster page is still there
* at /poster for anyone who wants it; it is just not what this button does.
*/
$('saveQr').addEventListener('click', () => {
const base = shareBase();
if (!base) { log('no address to encode yet', 'err'); return; }
const a = document.createElement('a');
a.href = 'http://127.0.0.1:' + state.local.port + '/qr.svg?url=' +
encodeURIComponent(base + '/');
a.download = 'church-translate-qr.svg';
document.body.appendChild(a);
a.click();
a.remove();
log('saved the QR for ' + base + '/', 'ok');
});
$('openOperator').addEventListener('click', () => {
window.open('http://127.0.0.1:' + state.local.port + '/operator', '_blank');