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 = {
"API_CONNECTED": api.connected.toString(),
"ACTIVITIES": activityToHTML.activitiesToHTML(api.lanyard),
"SPINCOUNT": globalSpins,
"UPTIME": timeFormatter((Date.now() - uptime) / 1000),

View file

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

View file

@ -20,7 +20,7 @@
<meta content="https://api.violets-purgatory.dev/v1/pfp" property="og:image" />
<meta content="#a200ff" data-react-helmet="true" name="theme-color" />
</head>
<body>
{WEATHER_MODIFIER}
<a href="../" class="chip">Home</a>
@ -42,6 +42,9 @@
<li>Uptime: {UPTIME}</li>
<li>Last Lanyard update: {LAST_LANYARD}</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>
</main>
</div>