feat (ui): aantal netwerken weergeven in netwerk knop in linker menu
This commit is contained in:
@@ -620,9 +620,10 @@
|
|||||||
try {
|
try {
|
||||||
if (currentTab === 'containers') await fetchContainers();
|
if (currentTab === 'containers') await fetchContainers();
|
||||||
else {
|
else {
|
||||||
const [pods, containers] = await Promise.all([
|
const [pods, containers, networks] = await Promise.all([
|
||||||
api('/pods-dashboard','GET'),
|
api('/pods-dashboard','GET'),
|
||||||
api('/containers-dashboard','GET')
|
api('/containers-dashboard','GET'),
|
||||||
|
api('/networks','GET').catch(() => ({ networks: [] }))
|
||||||
]);
|
]);
|
||||||
document.getElementById('countPods').textContent = (pods || []).length;
|
document.getElementById('countPods').textContent = (pods || []).length;
|
||||||
|
|
||||||
@@ -630,6 +631,8 @@
|
|||||||
const cCount = list.length;
|
const cCount = list.length;
|
||||||
document.getElementById('countContainers').textContent = cCount;
|
document.getElementById('countContainers').textContent = cCount;
|
||||||
updateNavCount('countNavContainers', cCount);
|
updateNavCount('countNavContainers', cCount);
|
||||||
|
const nCount = Array.isArray(networks?.networks) ? networks.networks.length : 0;
|
||||||
|
updateNavCount('countNavNetworks', nCount);
|
||||||
}
|
}
|
||||||
setApiState(true, 'API: OK');
|
setApiState(true, 'API: OK');
|
||||||
setLastRefreshNow();
|
setLastRefreshNow();
|
||||||
|
|||||||
Reference in New Issue
Block a user