more stats

This commit is contained in:
bingus_violet 2024-06-25 19:02:29 -05:00
parent e8e78a07aa
commit a72ce104f5
3 changed files with 9 additions and 1 deletions

View file

@ -240,6 +240,7 @@ function converter(html, dynamic = true) {
} }
var realtimeReplacers = { var realtimeReplacers = {
"API_CONNECTED": api.connected.toString(),
"ACTIVITIES": activityToHTML.activitiesToHTML(api.lanyard), "ACTIVITIES": activityToHTML.activitiesToHTML(api.lanyard),
"SPINCOUNT": globalSpins, "SPINCOUNT": globalSpins,
"UPTIME": timeFormatter((Date.now() - uptime) / 1000), "UPTIME": timeFormatter((Date.now() - uptime) / 1000),

View file

@ -110,6 +110,8 @@ window.onbeforeunload = function () {
window.onload = function () { window.onload = function () {
window.scrollTo(0, 0); window.scrollTo(0, 0);
$("#jsEnabled").text("true")
pfp = $(".pfp") pfp = $(".pfp")
spinLoop() spinLoop()
@ -173,6 +175,7 @@ function socketeer() {
sock.addEventListener("close", () => { sock.addEventListener("close", () => {
console.log("Connection Closed. Attempting Reconnect in 30 seconds.") console.log("Connection Closed. Attempting Reconnect in 30 seconds.")
$("#apiConnected").text("false")
setTimeout(() => { setTimeout(() => {
socketeer() socketeer()
}, 30000); }, 30000);
@ -182,6 +185,7 @@ function socketeer() {
data = data.data data = data.data
data = JSON.parse(data) data = JSON.parse(data)
if (data.op == 4) { if (data.op == 4) {
$("#apiConnected").text("true")
globalSpins = data.spins globalSpins = data.spins
if (firsttimeDebounce == true) { if (firsttimeDebounce == true) {
firsttimeDebounce = false firsttimeDebounce = false

View file

@ -42,6 +42,9 @@
<li>Uptime: {UPTIME}</li> <li>Uptime: {UPTIME}</li>
<li>Last Lanyard update: {LAST_LANYARD}</li> <li>Last Lanyard update: {LAST_LANYARD}</li>
<li>Last Pregeneration: {LAST_PREGEN}</li> <li>Last Pregeneration: {LAST_PREGEN}</li>
<li>Server connected to API: {API_CONNECTED}</li>
<li>Javascript Loaded/Enabled: <span id="jsEnabled">false</span></li>
<li>Client connected to API: <span id="apiConnected">false</span></li>
</ul> </ul>
</main> </main>
</div> </div>