debug und oidc

This commit is contained in:
2026-03-04 22:35:27 +01:00
parent c4b317d047
commit 43d0de3c5f
5 changed files with 147 additions and 1 deletions

View File

@@ -27,3 +27,57 @@
});
});
})();
(() => {
const openBtn = document.querySelector('[data-debug-open]');
const modal = document.getElementById('debug-modal');
if (!openBtn || !modal) return;
const listEl = document.getElementById('debug-log-list');
const contentEl = document.getElementById('debug-log-content');
const closeEls = modal.querySelectorAll('[data-debug-close]');
const open = () => {
modal.classList.add('is-open');
modal.setAttribute('aria-hidden', 'false');
loadList();
};
const close = () => {
modal.classList.remove('is-open');
modal.setAttribute('aria-hidden', 'true');
};
const loadList = async () => {
try {
const res = await fetch('/debug?list=1', { cache: 'no-store' });
const files = await res.json();
listEl.innerHTML = '';
files.forEach((f) => {
const a = document.createElement('a');
a.href = '#';
a.textContent = f;
a.addEventListener('click', (e) => {
e.preventDefault();
loadFile(f);
});
const li = document.createElement('li');
li.appendChild(a);
listEl.appendChild(li);
});
if (files.includes('oidc_login.log')) {
loadFile('oidc_login.log');
}
} catch (e) {}
};
const loadFile = async (name) => {
try {
const res = await fetch(`/debug?raw=1&file=${encodeURIComponent(name)}`, { cache: 'no-store' });
const text = await res.text();
contentEl.textContent = text;
} catch (e) {}
};
openBtn.addEventListener('click', open);
closeEls.forEach((el) => el.addEventListener('click', close));
})();