mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-08 23:57:46 +00:00
feat: color log info
This commit is contained in:
parent
34e2fd23ac
commit
c13c38d785
1 changed files with 8 additions and 4 deletions
12
index.html
12
index.html
|
@ -137,8 +137,12 @@
|
|||
// update view list
|
||||
const view = document.getElementById(`view-${idx}`);
|
||||
if (view) {
|
||||
const lines = nodes.map((n2, j) => `${j + 1}: ${node.view[n2.host]?.online ? 'online' : 'offline'}`);
|
||||
view.textContent = lines.join('\n');
|
||||
const lines = nodes.map((n2, j) => {
|
||||
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
|
||||
// ─────────────────────────────────────────────────────────────────────
|
||||
setInterval(pollLogs, 2000); // every 2s
|
||||
setInterval(pollMaps, 3000); // every 3s
|
||||
setInterval(pollLogs, 1000); // every 1
|
||||
setInterval(pollMaps, 1000); // every 1
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue