From 8ead7687e5fe1cc8cf3fb1f65be64d906a723ea3 Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 28 Mar 2026 15:15:55 -0400 Subject: [PATCH] fix: populate nav instance count on direct detail page load/refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nav-count was only set in renderDashboard, so loading /instance/:vmid directly left it showing "—". Add getInstances() to the parallel fetch in renderDetailPage and set the count there too. Co-Authored-By: Claude Sonnet 4.6 --- js/ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui.js b/js/ui.js index 95f3a63..4bbb462 100644 --- a/js/ui.js +++ b/js/ui.js @@ -156,9 +156,10 @@ function fmtHistVal(field, val) { } async function renderDetailPage(vmid) { - const [inst, history] = await Promise.all([getInstance(vmid), getInstanceHistory(vmid)]); + const [inst, history, all] = await Promise.all([getInstance(vmid), getInstanceHistory(vmid), getInstances()]); if (!inst) { navigate('dashboard'); return; } currentVmid = vmid; + document.getElementById('nav-count').textContent = `${all.length} instance${all.length !== 1 ? 's' : ''}`; document.getElementById('detail-vmid-crumb').textContent = vmid; document.getElementById('detail-name').textContent = inst.name;