igor.milhit/static/js/on_fiber.js

17 lines
437 B
JavaScript
Raw Permalink Normal View History

const url = 'https://id-libre.org/live/status-json.xsl';
const statusElement = document.getElementById('on');
async function status() {
const response = await fetch(url);
const data = await response.json();
const status = data.icestats.source ? 'on' : 'off'
statusElement.innerHTML = status;
statusElement.classList.remove("on", "off");
statusElement.classList.add(status);
}
status();
setInterval(() => status(), 2000);