feat (ui): netwerk map functionaliteit verder uitgebreid en polish

This commit is contained in:
kodi
2026-02-24 12:37:17 +01:00
parent 289d222707
commit ec13059437
4 changed files with 100 additions and 13 deletions
+9 -1
View File
@@ -165,7 +165,15 @@ async function buildImage() {
})
});
const data = await res.json();
const ct = (res.headers.get("content-type") || "").toLowerCase();
let data;
if (ct.includes("application/json")) {
data = await res.json();
} else {
const text = await res.text();
data = { ok: res.ok, status: res.status, non_json: true, body: text.slice(0, 4000) };
}
if (!res.ok) {
outputBox.value += "\nERROR:\n" + JSON.stringify(data, null, 2);