xyplon
commited on
Update static/models.js (#3)
Browse files- Update static/models.js (158a2496d7a9f5d06b73ce82a5f053ef6f65120c)
- static/models.js +14 -0
static/models.js
CHANGED
@@ -223,4 +223,18 @@ btn.onclick = async () => {
|
|
223 |
generateImage()
|
224 |
|
225 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
|
|
|
223 |
generateImage()
|
224 |
|
225 |
}
|
226 |
+
async function fetchData() {
|
227 |
+
try {
|
228 |
+
const response = await fetch('https://xyplon.onrender.com/');
|
229 |
+
if (!response.ok) {
|
230 |
+
throw new Error(`HTTP error! Status: ${response.status}`);
|
231 |
+
}
|
232 |
+
const data = await response.json();
|
233 |
+
const formattedData = `Pending Requests: ${data["Pending (Generating): "]} Total Requests: ${data["Total Requests: "]}`;
|
234 |
+
document.getElementById('stats').textContent = formattedData;
|
235 |
+
} catch (error) {
|
236 |
+
document.getElementById('stats').textContent = `Error: ${error.message}`;
|
237 |
+
}
|
238 |
+
}
|
239 |
|
240 |
+
setInterval(fetchData, 1000);
|