fix: populate nav instance count on direct detail page load/refresh #29
3
js/ui.js
3
js/ui.js
@@ -156,9 +156,10 @@ function fmtHistVal(field, val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function renderDetailPage(vmid) {
|
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; }
|
if (!inst) { navigate('dashboard'); return; }
|
||||||
currentVmid = vmid;
|
currentVmid = vmid;
|
||||||
|
document.getElementById('nav-count').textContent = `${all.length} instance${all.length !== 1 ? 's' : ''}`;
|
||||||
|
|
||||||
document.getElementById('detail-vmid-crumb').textContent = vmid;
|
document.getElementById('detail-vmid-crumb').textContent = vmid;
|
||||||
document.getElementById('detail-name').textContent = inst.name;
|
document.getElementById('detail-name').textContent = inst.name;
|
||||||
|
|||||||
Reference in New Issue
Block a user