automc ui: per-route active connection counts + total in header
CI / validate (push) Successful in 15s
CI / docker (push) Successful in 12s

Pulls mc_router_active_connections + mc_router_server_active_connections
from the Prometheus default registry on every /api/routes call. UI
gains an Active column on the routes table and the header subtitle
shows "N routes · M active conn".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 18:39:59 +02:00
parent b995e012be
commit 39d7d4586b
2 changed files with 67 additions and 8 deletions
+6 -2
View File
@@ -74,6 +74,7 @@
<tr>
<th>Server address (host)</th>
<th>Backend</th>
<th style="text-align:right;">Active</th>
</tr>
</thead>
<tbody id="route-rows"></tbody>
@@ -106,11 +107,14 @@ async function refreshRoutes() {
count.textContent = '(' + j.routes.length + ')';
for (const r of j.routes) {
const tr = document.createElement('tr');
tr.innerHTML = '<td>' + r.server_address + '</td><td>' + r.backend + '</td>';
tr.innerHTML = '<td>' + r.server_address + '</td>' +
'<td>' + r.backend + '</td>' +
'<td style="text-align:right;font-variant-numeric:tabular-nums;">' + r.active_connections + '</td>';
rows.appendChild(tr);
}
}
document.getElementById('meta').textContent = '— ' + j.routes.length + ' routes';
document.getElementById('meta').textContent =
'— ' + j.routes.length + ' routes · ' + (j.total_connections || 0) + ' active conn';
} catch (e) {
document.getElementById('meta').textContent = '— api error';
}