fix(web): escHtml verarbeitet Zahlen korrekt, Status-Tab Fehlertext verbessert
escHtml() rief .replace() auf Number-Werten auf (httpTotal aus Metriken) → TypeError. Fix: immer String(str) konvertieren. Außerdem console.error im Status-Tab-catch für einfachere Fehlerdiagnose. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ea923ffc61
commit
296138ac1e
2 changed files with 4 additions and 3 deletions
|
|
@ -329,8 +329,8 @@ loadMe();
|
||||||
|
|
||||||
// ---------- Hilfsfunktionen ----------
|
// ---------- Hilfsfunktionen ----------
|
||||||
function escHtml(str) {
|
function escHtml(str) {
|
||||||
if (!str) return "";
|
if (str === null || str === undefined || str === "") return "";
|
||||||
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmtDate(iso) {
|
function fmtDate(iso) {
|
||||||
|
|
@ -760,6 +760,7 @@ async function loadStatus() {
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error("loadStatus error:", e);
|
||||||
container.innerHTML = '<p class="text-sm text-red-500">Fehler beim Laden.</p>';
|
container.innerHTML = '<p class="text-sm text-red-500">Fehler beim Laden.</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,6 @@
|
||||||
<div id="status" class="w-full max-w-3xl mx-auto mt-1 min-h-[1rem] text-xs text-slate-500 dark:text-slate-400"></div>
|
<div id="status" class="w-full max-w-3xl mx-auto mt-1 min-h-[1rem] text-xs text-slate-500 dark:text-slate-400"></div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/app.js?v=9"></script>
|
<script src="/app.js?v=11"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue