mirror of
https://github.com/jakejarvis/npqueue.git
synced 2026-07-26 07:16:03 -04:00
auto-update table
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
+5
-4
@@ -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>
|
||||
@@ -26,9 +26,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Updates every 15 seconds.</p>
|
||||
<script src="fetch.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user