Updated LE & RR Sites

The following stats are now pulled through the NodeJS Backend:

- CurrentVersion
- ThunderstoreRating
This commit is contained in:
Pengu 2025-04-08 10:53:04 -05:00
parent fdf79ac2e4
commit 79820216e0
8 changed files with 187 additions and 12 deletions

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.6.6</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version:</a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -143,6 +143,19 @@
<a class="main2_feature_text" href=""></a> <a class="main2_feature_text" href=""></a>
</div> </div>
</div> </div>
<script>
// Fetch the latest version from the provided API URL
fetch('https://lethunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
</div> </div>
</body> </body>
</html> </html>

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.6.6</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version:</a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -1058,6 +1058,19 @@
</div> </div>
</div> </div>
</div> </div>
<script>
// Fetch the latest version from the provided API URL
fetch('https://lethunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
</div> </div>
</body> </body>
</html> </html>

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.6.6</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version:</a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -62,6 +62,54 @@
<a>Lethal Company,<br>but</a> <a>Lethal Company,<br>but</a>
<a class="main1_actcent">better</a><a>.</a> <a class="main1_actcent">better</a><a>.</a>
</div> </div>
<title>Player Counts</title>
<style>
#player-count {
font-size: 2em;
color: #ebe3e3;
}
#loading {
display: none;
color: #777;
}
</style>
<div class="main1_actcent" id="rating-text">Loading...</div>
<div class="main1_actcent" id="player-count">Loading...</div>
<script>
const playerCountElement = document.getElementById('player-count');
const prometheusURL = 'https://prometheus.pengucc.com/api/v1/query?query=le_active_users';
// Function to fetch player count from Prometheus
async function fetchPlayerCount() {
try {
const response = await fetch(prometheusURL);
const data = await response.json();
// Extract the player count from the response
if (data.status === 'success' && data.data.result.length > 0) {
const playerCount = data.data.result[0].value[1];
playerCountElement.textContent = `Current Player Count: ${playerCount}`;
} else {
playerCountElement.textContent = 'No data';
}
} catch (error) {
console.error('Error fetching player count:', error);
playerCountElement.textContent = 'Error fetching data';
} finally {
}
}
// Fetch player count every 15 seconds
setInterval(fetchPlayerCount, 5000);
// Initial fetch when the page loads
fetchPlayerCount();
</script>
<p></p>
<button class="main1_ipcopier" type="button"> <button class="main1_ipcopier" type="button">
<span class="main1_ipcopier_text1"></span> <span class="main1_ipcopier_text1"></span>
<a class="main1_ipcopier_text1" href="https://forum.lethal-extended.com">Lethal-Extended Forum</a> <a class="main1_ipcopier_text1" href="https://forum.lethal-extended.com">Lethal-Extended Forum</a>
@ -155,10 +203,32 @@
</div> </div>
</div> </div>
</div> </div>
</div> <script>
</div> // Fetch the latest version from the provided API URL
</div> fetch('https://lethunderstore.lethal-extended.com/api/downloads')
</div> .then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
<script>
// Fetch the rating score from the provided API URL
fetch('https://lethunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const ratingScore = data.rating_score;
document.getElementById('rating-text').innerText = `Thunderstore Rating: ${ratingScore.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching rating score:', error);
document.getElementById('rating-text').innerText = 'Failed to load rating score';
});
</script>
</div> </div>
</body> </body>
</html> </html>

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.6.6</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version:</a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -125,6 +125,19 @@
</center> </center>
</div> </div>
</div> </div>
<script>
// Fetch the latest version from the provided API URL
fetch('https://lethunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
</div> </div>
</body> </body>
</html> </html>

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.0.9</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version: </a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -143,6 +143,19 @@
<a class="main2_feature_text" href=""></a> <a class="main2_feature_text" href=""></a>
</div> </div>
</div> </div>
<script>
// Fetch the latest version from the provided API URL
fetch('https://rrthunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
</div> </div>
</body> </body>
</html> </html>

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.0.9</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version: </a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -283,6 +283,19 @@
</div> </div>
</div> </div>
</div> </div>
<script>
// Fetch the latest version from the provided API URL
fetch('https://rrthunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
</div> </div>
</body> </body>
</html> </html>

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.0.9</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version: </a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -75,6 +75,7 @@
} }
</style> </style>
<div class="main1_actcent" id="rating-text">Loading...</div>
<div class="main1_actcent" id="player-count">Loading...</div> <div class="main1_actcent" id="player-count">Loading...</div>
<script> <script>
@ -118,6 +119,32 @@
<a class="main1_ipcopier_text1" href="applications.html">Team Applications</a> <a class="main1_ipcopier_text1" href="applications.html">Team Applications</a>
</button> </button>
</div> </div>
<script>
// Fetch the latest version from the provided API URL
fetch('https://rrthunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
<script>
// Fetch the rating score from the provided API URL
fetch('https://rrthunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const ratingScore = data.rating_score;
document.getElementById('rating-text').innerText = `Thunderstore Rating: ${ratingScore.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching rating score:', error);
document.getElementById('rating-text').innerText = 'Failed to load rating score';
});
</script>
</div> </div>
</body> </body>
</html> </html>

View File

@ -24,7 +24,7 @@
<a href="./aboutus.html" class="desktop_navbar_link">About Us</a> <a href="./aboutus.html" class="desktop_navbar_link">About Us</a>
<a href="./credits.html" class="desktop_navbar_link">Credits</a> <a href="./credits.html" class="desktop_navbar_link">Credits</a>
<a href="./projects.html" class="desktop_navbar_link">Projects</a> <a href="./projects.html" class="desktop_navbar_link">Projects</a>
<a class="desktop_navbar_link scroll">Current Version: 0.0.9</a> <a class="desktop_navbar_link scroll" id="version-text">Current Version: </a>
<div class="desktop_navbar_link2_div"> <div class="desktop_navbar_link2_div">
<a href="./downloads.html" class="desktop_navbar_link2">Download</a> <a href="./downloads.html" class="desktop_navbar_link2">Download</a>
</div> </div>
@ -125,6 +125,19 @@
</center> </center>
</div> </div>
</div> </div>
<script>
// Fetch the latest version from the provided API URL
fetch('https://rrthunderstore.lethal-extended.com/api/downloads')
.then(response => response.json())
.then(data => {
const latestVersion = data.latest_version;
document.getElementById('version-text').innerText = `Current Version: ${latestVersion.toLocaleString()}`;
})
.catch(error => {
console.error('Error fetching latest version:', error);
document.getElementById('version-text').innerText = 'Failed to load latest version';
});
</script>
</div> </div>
</body> </body>
</html> </html>