mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-09 08:07:47 +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
|
// 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>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue