This commit is contained in:
2025-12-27 02:49:04 +01:00
parent 03bb9de416
commit c0558ec6b8
4 changed files with 18 additions and 6 deletions

View File

@@ -88,11 +88,16 @@ if ($debugEnabled) {
select.addEventListener('change', ()=>{
const file = select.value;
if (!file) { content.innerHTML = '<p class="muted">Log auswählen, um Inhalt zu sehen.</p>'; return; }
fetch('/debug?file=' + encodeURIComponent(file))
fetch('/debug?file=' + encodeURIComponent(file) + '&raw=1')
.then(r => r.text())
.then(html => {
// naive extract content from /debug page: we just display raw text
content.innerHTML = '<pre>'+html.replace(/</g,'&lt;')+'</pre>';
.then(text => {
const escape = (s) => s
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
content.innerHTML = '<pre>'+escape(text)+'</pre>';
})
.catch(()=> content.innerHTML = '<p class="muted">Konnte Log nicht laden.</p>');
});