From 58c564d263d4c5cbfee0a3c76f4240100d8ad244 Mon Sep 17 00:00:00 2001 From: oliver Date: Tue, 9 Jun 2026 14:59:02 -0300 Subject: [PATCH] Update app.js --- app.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 013a71b..901f84f 100644 --- a/app.js +++ b/app.js @@ -66,6 +66,15 @@ function normalizeAgents(raw) { if (!Array.isArray(raw)) return []; // unwrap double-wrapped array: [[{…}]] → [{…}] if (raw.length > 0 && Array.isArray(raw[0])) return normalizeAgents(raw[0]); + // unwrap [{data:[…]}] envelope (agents list with nested data array) + if ( + raw.length > 0 && + raw[0] !== null && + typeof raw[0] === "object" && + Array.isArray(raw[0].data) + ) { + return normalizeAgents(raw[0].data); + } // unwrap n8n {json:{…}} envelope if ( raw.length > 0 && @@ -847,7 +856,7 @@ function renderKeys(keys) { day: "numeric", year: "numeric", }) - : "\u2014"; + : ""; const statusColor = k.disabled ? "var(--danger)" : "var(--success)"; const statusLabel = k.disabled ? "Disabled" : "Active"; @@ -867,8 +876,7 @@ function renderKeys(keys) { ${k.limit_remaining ?? "\u2014"} / ${total} credits - · - ${exp} + ${exp ? `·${escHtml(exp)}` : ""}