feat(sysadmin): the venue's menu and ordering links from PUBLIC_APPS_URL; 3S pack notes
Plan phase 3S, step S.99. - SiteOut.apps_url (the cloud's PUBLIC_APPS_URL; a Site property, not stored per site). - Sysadmin site page: the QR menu and online ordering links/QR codes are built from it (were a hard-coded IP and a "/menu/<site>/order" route that never existed); a note when PUBLIC_APPS_URL isn't set, and that table codes are printed by the venue. - Pack README: connect_frontend and /api/menu rows for phase 3S, CL-9 (rate limits are per process), CL-10 (table QR tokens: hashes only). - Test: the sysadmin gets the apps address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -466,9 +466,12 @@ export default function SiteDetailPage() {
|
||||
|
||||
{/* QR Codes */}
|
||||
{(() => {
|
||||
// the customer apps' address comes from the cloud (PUBLIC_APPS_URL, phase 3S); the
|
||||
// tables' own QR codes (ordering at a table) are printed by the venue's manager
|
||||
const slug = site.site_id
|
||||
const menuUrl = `http://72.61.191.197:3100/menu/${slug}`
|
||||
const orderUrl = `http://72.61.191.197:3100/menu/${slug}/order`
|
||||
const base = site.apps_url || import.meta.env.VITE_CLOUD_URL || window.location.origin
|
||||
const menuUrl = `${base}/menu/${slug}`
|
||||
const orderUrl = `${base}/order/${slug}`
|
||||
|
||||
function handleDownload(canvasId, filename) {
|
||||
const canvas = document.getElementById(canvasId)
|
||||
@@ -482,11 +485,12 @@ export default function SiteDetailPage() {
|
||||
|
||||
return (
|
||||
<div className="bg-gray-900 border border-gray-700 rounded-xl p-4 mt-4">
|
||||
<h2 className="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-4">QR Codes</h2>
|
||||
<h2 className="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1">QR Codes</h2>
|
||||
<p className="text-xs text-gray-500 mb-4">{site.apps_url ? '' : 'PUBLIC_APPS_URL is not set on the cloud: these links use the API address. '}Table codes (ordering at a table) are printed by the venue: manager → Table QR codes.</p>
|
||||
<div className="flex flex-wrap gap-8">
|
||||
{[
|
||||
{ id: `qr-menu-${site.id}`, url: menuUrl, label: 'Menu QR Code', file: `menu-qr-${slug}.png` },
|
||||
{ id: `qr-order-${site.id}`, url: orderUrl, label: 'Order QR Code', file: `order-qr-${slug}.png` },
|
||||
{ id: `qr-menu-${site.id}`, url: menuUrl, label: 'QR menu (to read)', file: `menu-qr-${slug}.png` },
|
||||
{ id: `qr-order-${site.id}`, url: orderUrl, label: 'Online ordering (takeaway, delivery, bookings)', file: `order-qr-${slug}.png` },
|
||||
].map(({ id, url, label, file }) => (
|
||||
<div key={id} className="flex flex-col items-center gap-3">
|
||||
<p className="text-xs font-medium text-gray-400">{label}</p>
|
||||
|
||||
Reference in New Issue
Block a user