Fix relative paths for Caddy prefix stripping

This commit is contained in:
Richard Sauer 2026-04-08 12:10:57 +10:00
parent 592d4bf6fb
commit 5c33a29bc7

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>BFA Banana Dryer — HMI Design Tool</title> <title>BFA Banana Dryer — HMI Design Tool</title>
<script src="/static/sortable.min.js"></script> <script src="static/sortable.min.js"></script>
<style> <style>
*{margin:0;padding:0;box-sizing:border-box;user-select:none;-webkit-tap-highlight-color:transparent} *{margin:0;padding:0;box-sizing:border-box;user-select:none;-webkit-tap-highlight-color:transparent}
:root{--bg:#0a0e17;--card:#131a2b;--border:#1e2a45;--text:#e8ecf4;--text2:#7a8baa;--dim:#4a5670;--blue:#2d7ff9;--green:#00c853;--amber:#ffab00;--red:#ff1744;--thot:#ff4444;--twarm:#ff8844;--tcool:#44aaff;--track:#1a2240} :root{--bg:#0a0e17;--card:#131a2b;--border:#1e2a45;--text:#e8ecf4;--text2:#7a8baa;--dim:#4a5670;--blue:#2d7ff9;--green:#00c853;--amber:#ffab00;--red:#ff1744;--thot:#ff4444;--twarm:#ff8844;--tcool:#44aaff;--track:#1a2240}
@ -250,7 +250,7 @@ let sortableInstance = null;
// INIT // INIT
// ══════════════════════════════════════════════════════ // ══════════════════════════════════════════════════════
async function init() { async function init() {
const resp = await fetch('/api/layout'); const resp = await fetch('api/layout');
layout = await resp.json(); layout = await resp.json();
if (!currentUser && layout.users.length > 0) currentUser = layout.users[0]; if (!currentUser && layout.users.length > 0) currentUser = layout.users[0];
initUsers(); initUsers();
@ -284,7 +284,7 @@ function initSimState() {
async function addUser() { async function addUser() {
const name = prompt('Enter name:'); const name = prompt('Enter name:');
if (!name) return; if (!name) return;
await fetch('/api/users', {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({name})}); await fetch('api/users', {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({name})});
layout.users.push(name); layout.users.push(name);
currentUser = name; currentUser = name;
localStorage.setItem('bfa-user', name); localStorage.setItem('bfa-user', name);
@ -540,7 +540,7 @@ function closeComments() { document.getElementById('comment-panel').classList.re
async function submitComment() { async function submitComment() {
const text = document.getElementById('comment-text').value.trim(); const text = document.getElementById('comment-text').value.trim();
if (!text || !commentTarget) return; if (!text || !commentTarget) return;
const resp = await fetch('/api/comment', { const resp = await fetch('api/comment', {
method: 'POST', headers: {'Content-Type': 'application/json'}, method: 'POST', headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target: commentTarget, user: currentUser, text}) body: JSON.stringify({target: commentTarget, user: currentUser, text})
}); });
@ -555,7 +555,7 @@ async function submitComment() {
// SAVE / EXPORT // SAVE / EXPORT
// ══════════════════════════════════════════════════════ // ══════════════════════════════════════════════════════
async function saveLayout() { async function saveLayout() {
await fetch('/api/layout', {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(layout)}); await fetch('api/layout', {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(layout)});
alert('Layout saved!'); alert('Layout saved!');
} }