From a52744a448a869d4641c43bcae50109a523bc270 Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Sun, 10 May 2026 08:31:32 -0400 Subject: [PATCH] feat: fetch and render host info section on card expand --- hbd/server/templates/plugins.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hbd/server/templates/plugins.html b/hbd/server/templates/plugins.html index a6b27e8..eac8a71 100644 --- a/hbd/server/templates/plugins.html +++ b/hbd/server/templates/plugins.html @@ -724,8 +724,21 @@ const card = document.querySelector(`.host-card[data-hostname="${hostname}"]`); const wasCollapsed = card.classList.contains('collapsed'); card.classList.toggle('collapsed'); - if (wasCollapsed && !pluginCache[hostname]) { - fetchHostGlance(hostname); + if (wasCollapsed) { + if (!pluginCache[hostname]) { + fetchHostGlance(hostname); + } + if (!infoCache[hostname]) { + const infoEl = document.getElementById(`info-${hostname}`); + if (infoEl) infoEl.innerHTML = '
Loading…
'; + fetchHostInfo(hostname).then(data => { + infoCache[hostname] = data; + renderInfoSection(hostname, data); + }).catch(() => { + const el = document.getElementById(`info-${hostname}`); + if (el) el.innerHTML = '
Could not load host info.
'; + }); + } } }