From 7444262985c8ecb6209a7ad187cc5dcea58a2d4f Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Sun, 10 May 2026 14:08:37 -0400 Subject: [PATCH] fix: fetch host info on initial page load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DOMContentLoaded was calling fetchHostGlance but not fetchHostInfo, leaving the info-meta section stuck on "Loading…". Both the URL-hash and default first-host paths now call fetchHostInfo and populate infoCache on load. Co-Authored-By: Claude Sonnet 4.6 --- hbd/server/templates/plugins.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hbd/server/templates/plugins.html b/hbd/server/templates/plugins.html index 5171553..b7eb804 100644 --- a/hbd/server/templates/plugins.html +++ b/hbd/server/templates/plugins.html @@ -1336,14 +1336,29 @@ if (card) { card.classList.remove('collapsed'); fetchHostGlance(hostname); + 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.
'; + }); setTimeout(() => card.scrollIntoView({ behavior: 'smooth', block: 'start' }), 150); return; } } const first = document.querySelector('.host-card'); if (first) { + const hostname = first.dataset.hostname; first.classList.remove('collapsed'); - fetchHostGlance(first.dataset.hostname); + fetchHostGlance(hostname); + 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.
'; + }); } }); // ── Host action helpers ──────────────────────────────────────