remove Enable Admin API toggle
Publish Docker image / build (push) Failing after 3s

This commit is contained in:
Daniel committed 2026-04-07 13:57:49 +02:00
1 parent c88cd118be
commit 8464c4fb4e
1 file changed
+3 -30
+3 -30
View File
@@ -566,18 +566,10 @@ textarea.code:focus { border-color: var(--accent); }
<div class="panel-header" onclick="togglePanel('global')">
<span class="chev open" id="global-chev">▶</span>
<span class="panel-title">Global Options</span>
<span class="badge on" id="admin-badge" style="display:none">admin enabled</span>
</div>
<div class="panel-body" id="global-body">
<div class="toolbar">
<label class="toggle-wrap">
<input type="checkbox" id="admin-toggle" onchange="toggleAdmin(this.checked)">
Enable Admin API
</label>
<span class="toggle-hint">— required for KonCad to reach Caddy</span>
</div>
<textarea class="code" id="global-editor" rows="8"
placeholder="# Global options&#10;email admin@example.com&#10;&#10;# Enable admin API for KonCad:&#10; admin :2019"></textarea>
placeholder="# Global options&#10;email admin@example.com&#10;admin :2019"></textarea>
</div>
</div>
@@ -621,7 +613,7 @@ async function init() {
if (!d.ok) throw new Error(d.error);
document.getElementById('global-editor').value = d.data.global;
sites = d.data.sites;
syncAdminToggle();
renderSites();
try {
@@ -827,25 +819,6 @@ function togglePanel(id) {
chev.classList.toggle('open', !open);
}
// ─── Admin toggle ─────────────────────────────────────────────────────────────
function syncAdminToggle() {
const val = document.getElementById('global-editor').value;
const enabled = /^\s*admin(?!\s+off)\b/m.test(val);
document.getElementById('admin-toggle').checked = enabled;
document.getElementById('admin-badge').style.display = enabled ? '' : 'none';
}
function toggleAdmin(enable) {
const ta = document.getElementById('global-editor');
if (enable) {
if (!/^\s*admin(?!\s+off)\b/m.test(ta.value)) {
ta.value = (ta.value.trimEnd() ? ta.value.trimEnd() + '\n' : '') + ' admin :2019\n';
}
} else {
ta.value = ta.value.replace(/^[ \t]*admin\b.*\n?/mg, '');
}
syncAdminToggle();
}
// ─── Modal ────────────────────────────────────────────────────────────────────
function showModal(unreachable) {
@@ -907,7 +880,7 @@ function handleTab(e) {
}
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('global-editor').addEventListener('input', syncAdminToggle);
init();
});
</script>