1
mirror of https://github.com/jakejarvis/npqueue.git synced 2025-11-04 10:20:10 -05:00

auto-update table

This commit is contained in:
2019-06-15 22:31:17 -04:00
parent 6f0785d031
commit 8a7955d638
2 changed files with 7 additions and 4 deletions

View File

@@ -25,6 +25,8 @@ function updateTable(data) {
queue.innerText = `In Queue: ${data.currentQueue}`;
table = document.getElementsByTagName("table")[0].getElementsByTagName("tbody")[0];
table.innerHTML = "";
data.players = data.players.sort((a, b) => (a.id > b.id) ? 1 : ((b.id > a.id) ? -1 : 0));

View File

@@ -4,14 +4,14 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>NoPixel GTA5 RP Online Players</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 id="title">NoPixel Server 1</h1>
<h1 id="title">NoPixel Players (Server 1)</h1>
<h2 id="active">Active Players:</h2>
<h2 id="queue">In Queue:</h2>
<p>Please report missing or inaccurate on <a href="#">GitHub</a> or <a href="mailto:nopixellist@gmail.com">via email</a>.</p>
<p>Please report missing or inaccurate <a href="https://github.com/jakejarvis/npqueue/issues/new" target="_blank" rel="noopener noreferrer nofollow">on GitHub</a> or <a href="mailto:nopixellist@gmail.com">via email</a>.</p>
<table id="players">
<thead>
<tr>
@@ -29,6 +29,7 @@
</tbody>
</table>
<p>Updates every 15 seconds.</p>
<script src="fetch.js"></script>
</body>
</html>