This commit is contained in:
Christopher Cookman 2024-12-16 20:21:37 -07:00
commit e3ece6a02d
4 changed files with 9 additions and 2 deletions

View file

@ -53,4 +53,7 @@ function populateTable(routes) {
`;
tableBody.appendChild(row);
});
// populate serverCount
document.getElementById('serverCount').innerText = routes.length;
}

View file

@ -8,6 +8,8 @@ function getDirectoryEntries() {
row.innerHTML = `<td>${entry.number}</td><td>${entry.name}</td>`;
table.appendChild(row);
});
// Set dirCount to the number of entries in the directory
document.getElementById('dirCount').innerText = data.length;
})
.catch(error => console.error('Error fetching directory:', error));
}

View file

@ -18,8 +18,9 @@
<a href="/admin" class="btn btn-outline-light">Admin Login</a>
</div>
</nav>
<div class="d-flex align-items-center gap-3 mb-3">
<h2 class="m-0 text-center w-100">AstroCom Directory</h2>
<div class="d-flex align-items-center justify-content-center gap-3 mb-3">
<h2 class="m-0">AstroCom Directory</h2>
<p class="m-0">Total Entries: <span id="dirCount">0</span></p>
</div>
<div class="container mt-4" style="max-width: 400px;">
<table class="table table-dark table-striped">

View file

@ -21,6 +21,7 @@
<div class="d-flex align-items-center gap-3 mb-3">
<h2 class="m-0">Admin Dashboard</h2>
<a href="/admin/create" class="btn btn-primary">Create New Server</a>
<p class="m-0">Total Servers: <span id="serverCount">0</span> | Total Directory Entries: <span id="dirCount">0</span></p>
</div>
<div class="d-flex">
<div class="flex-grow-1">