mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
implement player count display
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user