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

@@ -239,6 +239,71 @@ body {
font-size: 22px;
box-shadow: 0 16px 32px rgba(255, 90, 61, 0.28);
z-index: 50;
border: none;
cursor: pointer;
}
.debug-modal {
position: fixed;
inset: 0;
display: none;
z-index: 80;
}
.debug-modal.is-open { display: block; }
.debug-modal__backdrop {
position: absolute;
inset: 0;
background: rgba(10, 12, 20, 0.35);
}
.debug-modal__panel {
position: relative;
max-width: 980px;
width: calc(100% - 40px);
margin: 60px auto;
padding: 16px;
}
.debug-modal__header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.debug-modal__close {
background: transparent;
border: none;
font-size: 20px;
cursor: pointer;
}
.debug-modal__body {
display: grid;
grid-template-columns: 220px 1fr;
gap: 16px;
}
.debug-modal__list ul {
list-style: none;
padding: 0;
margin: 8px 0 0;
display: grid;
gap: 6px;
}
.debug-modal__list a {
text-decoration: none;
color: var(--text);
padding: 6px 8px;
border-radius: 8px;
display: block;
}
.debug-modal__list a:hover { background: var(--panel-2); }
.debug-modal__content pre {
background: var(--panel-2);
padding: 10px;
border-radius: 8px;
max-height: 520px;
overflow: auto;
white-space: pre-wrap;
}
@media (max-width: 800px) {
.debug-modal__body { grid-template-columns: 1fr; }
}
.muted { color: var(--muted); }

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));
})();