2023-02-09 20:34:53 +00:00
|
|
|
init();
|
|
|
|
|
|
|
|
async function init() {
|
|
|
|
display(await get())
|
|
|
|
}
|
|
|
|
|
|
|
|
async function get() {
|
|
|
|
var url = `${window.location.origin}/api/v1/stats`;
|
|
|
|
var resp = await fetch(url);
|
|
|
|
return await resp.json();
|
|
|
|
}
|
|
|
|
|
|
|
|
async function display(data) {
|
|
|
|
document.getElementById('server_host').textContent = `HOST: ${data.host}`;
|
|
|
|
let dat = data.dat[0]
|
|
|
|
console.log(JSON.stringify(dat))
|
2023-02-12 21:42:53 +00:00
|
|
|
document.getElementById('time').textContent = convertUnixLocal(dat.since);
|
2023-02-09 20:34:53 +00:00
|
|
|
document.getElementById('ldbws').textContent = dat.ldbws || "0";
|
|
|
|
document.getElementById('ldbsvws').textContent = dat.ldbsvws || "0";
|
|
|
|
document.getElementById('corpus').textContent = dat.corpus || "0";
|
|
|
|
document.getElementById('stations').textContent = dat.stations || "0";
|
|
|
|
document.getElementById('users').textContent = dat.user || "0";
|
|
|
|
document.getElementById('meta').textContent = dat.meta || "0";
|
|
|
|
}
|