56 lines
1.6 KiB
Plaintext
56 lines
1.6 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Node Pool Status</title>
|
|
<style>
|
|
body { font-family: Arial, sans-serif; margin: 20px; }
|
|
table { border-collapse: collapse; width: 100%; }
|
|
th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
|
|
th { background-color: #f2f2f2; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Node Pool Status</h1>
|
|
<table id="pool">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>IP</th>
|
|
<th>Status</th>
|
|
<th>Role</th>
|
|
<th>Cluster</th>
|
|
<th>CPU (%)</th>
|
|
<th>Memory (%)</th>
|
|
<th>Last Active</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
<script>
|
|
async function loadPool() {
|
|
const res = await fetch('/status');
|
|
const data = await res.json();
|
|
const tbody = document.querySelector('#pool tbody');
|
|
tbody.innerHTML = '';
|
|
data.nodes.forEach(n => {
|
|
const tr = document.createElement('tr');
|
|
tr.innerHTML = `
|
|
<td>${n.name}</td>
|
|
<td>${n.ip}</td>
|
|
<td>${n.status}</td>
|
|
<td>${n.role}</td>
|
|
<td>${n.cluster ?? "none"}</td>
|
|
<td>${n.cpu}</td>
|
|
<td>${n.memory}</td>
|
|
<td>${n.last_active}</td>
|
|
`;
|
|
tbody.appendChild(tr);
|
|
});
|
|
}
|
|
setInterval(loadPool, 5000);
|
|
loadPool();
|
|
</script>
|
|
</body>
|
|
</html>
|