feat: color log info

This commit is contained in:
Matthew Esposito 2025-04-20 09:37:11 -04:00
parent 34e2fd23ac
commit c13c38d785

View file

@ -137,8 +137,12 @@
// update view list // update view list
const view = document.getElementById(`view-${idx}`); const view = document.getElementById(`view-${idx}`);
if (view) { if (view) {
const lines = nodes.map((n2, j) => `${j + 1}: ${node.view[n2.host]?.online ? 'online' : 'offline'}`); const lines = nodes.map((n2, j) => {
view.textContent = lines.join('\n'); const online = node.view[n2.host]?.online;
const color = online ? 'text-green-600' : 'text-red-600';
return `<span class="${color}">${j + 1}: ${online ? 'online' : 'offline'}</span>`;
});
view.innerHTML = lines.join('<br>');
} }
} }
} }
@ -220,8 +224,8 @@
// ───────────────────────────────────────────────────────────────────── // ─────────────────────────────────────────────────────────────────────
// Timers // Timers
// ───────────────────────────────────────────────────────────────────── // ─────────────────────────────────────────────────────────────────────
setInterval(pollLogs, 2000); // every 2s setInterval(pollLogs, 1000); // every 1
setInterval(pollMaps, 3000); // every 3s setInterval(pollMaps, 1000); // every 1
</script> </script>
</body> </body>