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)) document.getElementById('time').textContent = convertUnixLocal(dat.since); 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"; }