show nr of connections
This commit is contained in:
parent
0d90252e33
commit
97694cdd50
@ -74,6 +74,7 @@
|
||||
<li class="nav-item"><a href="{{ url_for('songs_dashboard') }}" class="nav-link">Auswertung-Wiederholungen</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<span>Anzahl Verbindungen: <strong id="totalConnections">0</strong></span>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@ -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);
|
||||
});
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user