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:
		
							
								
								
									
										2
									
								
								fetch.js
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								fetch.js
									
									
									
									
									
								
							@@ -25,6 +25,8 @@ function updateTable(data) {
 | 
				
			|||||||
  queue.innerText = `In Queue: ${data.currentQueue}`;
 | 
					  queue.innerText = `In Queue: ${data.currentQueue}`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  table = document.getElementsByTagName("table")[0].getElementsByTagName("tbody")[0];
 | 
					  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));
 | 
					  data.players = data.players.sort((a, b) => (a.id > b.id) ? 1 : ((b.id > a.id) ? -1 : 0));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,14 +4,14 @@
 | 
				
			|||||||
  <meta charset="utf-8">
 | 
					  <meta charset="utf-8">
 | 
				
			||||||
  <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
					  <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
				
			||||||
  <title>NoPixel GTA5 RP Online Players</title>
 | 
					  <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">
 | 
					  <link rel="stylesheet" href="style.css">
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
  <h1 id="title">NoPixel Server 1</h1>
 | 
					  <h1 id="title">NoPixel Players (Server 1)</h1>
 | 
				
			||||||
  <h2 id="active">Active Players:</h2>
 | 
					  <h2 id="active">Active Players:</h2>
 | 
				
			||||||
  <h2 id="queue">In Queue:</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">
 | 
					  <table id="players">
 | 
				
			||||||
    <thead>
 | 
					    <thead>
 | 
				
			||||||
      <tr>
 | 
					      <tr>
 | 
				
			||||||
@@ -26,9 +26,10 @@
 | 
				
			|||||||
      </tr>
 | 
					      </tr>
 | 
				
			||||||
    </thead>
 | 
					    </thead>
 | 
				
			||||||
    <tbody>
 | 
					    <tbody>
 | 
				
			||||||
      
 | 
					
 | 
				
			||||||
    </tbody>
 | 
					    </tbody>
 | 
				
			||||||
  </table>
 | 
					  </table>
 | 
				
			||||||
 | 
					  <p>Updates every 15 seconds.</p>
 | 
				
			||||||
  <script src="fetch.js"></script>
 | 
					  <script src="fetch.js"></script>
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user