From 97694cdd50be2e0b1197c2857dfb43fe0631775b Mon Sep 17 00:00:00 2001 From: lelo Date: Sat, 19 Apr 2025 14:25:56 +0000 Subject: [PATCH] show nr of connections --- templates/connections.html | 8 ++++++++ 1 file changed, 8 insertions(+) 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); });