implement player count display

This commit is contained in:
2021-03-25 13:54:56 +01:00
parent 4f2b51eaad
commit fdc269cbfd
4 changed files with 60 additions and 1 deletions

View File

@@ -10,6 +10,21 @@
{% include 'navbar_leaderboard.html' %}
<div class="container mt-3 mb-3" role="main">
<div id="playerDisplay" class="playerDisplay mb-3 mt-2">
<script>
fetch("/players-online").then(
response => response.json()
).then(
data => {
if(data["error"] == ""){
document.getElementById("playerDisplay").innerHTML = "Players Online: " + data["player_total"]
}else{
document.getElementById("playerDisplay").innerHTML = "Players Online: (error)" + data["error"]
}
}
)
</script>
</div>
<table id="tableMain" class="table table-striped table-bordered table-sm"
cellspacing="0">
<thead>