Reformat admin page

This commit is contained in:
Christopher Cookman 2024-12-17 01:49:04 -07:00
parent eaaa81d9f2
commit a3e3dfc501
2 changed files with 46 additions and 46 deletions

View file

@ -9,6 +9,8 @@ function getDirectoryEntries() {
row.innerHTML = `<td>${entry.number}</td><td>${entry.name}</td><td><button class="btn btn-danger" onclick="deleteDirectoryEntry(${entry.number})">Delete</button></td>`;
table.appendChild(row);
});
const dirCount = document.getElementById('dirCount');
dirCount.textContent = data.length;
})
.catch(error => console.error('Error fetching directory:', error));
}

View file

@ -1,11 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/assets/css/bootstrap.min.css">
<title>AstroCom Admin</title>
</head>
<body class="bg-dark text-white">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
@ -19,62 +21,58 @@
</div>
</div>
</nav>
<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="flex-grow-1 mb-3">
<table class="table table-striped table-dark" id="adminTable">
<thead>
<tr>
<th>ID</th>
<th>Hostname:Port</th>
<th>IAX Username/Context</th>
<th>IAX2 Secret</th>
<th>Number Block</th>
<th>API Key</th>
<th>Contact</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<!-- Data will be dynamically populated by adminMain.js -->
</tbody>
</table>
</div>
<div class="flex-grow-1">
<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">
<table class="table table-striped table-dark" id="adminTable">
<thead>
<tr>
<th>ID</th>
<th>Hostname:Port</th>
<th>IAX Username/Context</th>
<th>IAX2 Secret</th>
<th>Number Block</th>
<th>API Key</th>
<th>Contact</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<!-- Data will be dynamically populated by adminMain.js -->
</tbody>
</table>
</div>
<div class="d-flex">
<div class="flex-grow-1">
<!-- Original table is already in place above -->
</div>
<div class="ms-3 flex-grow-1">
<div class="d-flex align-items-center gap-3 mb-3">
<h2 class="m-0">Directory Management</h2>
</div>
<table class="table table-striped table-dark" id="directoryTable">
<thead>
<tr>
<th>Number</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="directoryList">
<!-- Data will be dynamically populated by adminMain.js -->
</tbody>
</table>
</div>
<h2 class="m-0">Directory Management</h2>
</div>
<table class="table table-striped table-dark" id="directoryTable">
<thead>
<tr>
<th>Number</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="directoryList">
<!-- Data will be dynamically populated by adminMain.js -->
</tbody>
</table>
</div>
<script src="/assets/js/adminDirectory.js"></script>
<script src="/assets/js/adminMain.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="/assets/js/bootstrap.bundle.min.js"></script>
<script src="/assets/js/jquery.min.js"></script>
<script>
$(function() {
$(function () {
$("#footer").load("/footer");
});
</script>
</body>
</html>