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 name="viewport" content="width=device-width,initial-scale=1">
<title>BFA Banana Dryer — HMI Design Tool</title>
<script src="/static/sortable.min.js"></script>
<script src="static/sortable.min.js"></script>
<style>
*{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}
@ -250,7 +250,7 @@ let sortableInstance = null;
// INIT
// ══════════════════════════════════════════════════════
async function init() {
const resp = await fetch('/api/layout');
const resp = await fetch('api/layout');
layout = await resp.json();
if (!currentUser && layout.users.length > 0) currentUser = layout.users[0];
initUsers();
@ -284,7 +284,7 @@ function initSimState() {
async function addUser() {
const name = prompt('Enter name:');
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);
currentUser = name;
localStorage.setItem('bfa-user', name);
@ -540,7 +540,7 @@ function closeComments() { document.getElementById('comment-panel').classList.re
async function submitComment() {
const text = document.getElementById('comment-text').value.trim();
if (!text || !commentTarget) return;
const resp = await fetch('/api/comment', {
const resp = await fetch('api/comment', {
method: 'POST', headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target: commentTarget, user: currentUser, text})
});
@ -555,7 +555,7 @@ async function submitComment() {
// SAVE / EXPORT
// ══════════════════════════════════════════════════════
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!');
}