document.addEventListener("DOMContentLoaded", function () { function color(heat) { if (heat < 30) return "#2ecc71"; if (heat < 60) return "#f1c40f"; if (heat < 80) return "#e67e22"; return "#e74c3c"; } document.getElementById("load").addEventListener("click", function () { cockpit.spawn( ["python3", "/usr/share/cockpit/fester/backend/nodes.py"], { superuser: "require" } ) .then(data => { const parsed = JSON.parse(data); let html = `
${JSON.stringify(parsed.master, null, 2)}