diff --git a/templates/connections.html b/templates/connections.html index be84e10..3573830 100644 --- a/templates/connections.html +++ b/templates/connections.html @@ -74,6 +74,7 @@ + Anzahl Verbindungen: 0 @@ -108,6 +109,12 @@ socket.emit("request_initial_data"); }); + // compute & write stats into the header + function updateStats(data) { + const total = data.length; + document.getElementById("totalConnections").textContent = total; + } + // Helper: Create a table row. // When applyAnimation is true, the row uses the slide-in animation. function createRow(record, applyAnimation = true) { @@ -202,6 +209,7 @@ // Listen for incoming connection data from the server. socket.on("recent_connections", function(data) { + updateStats(data); animateTableWithNewRow(data); });