Include fading in the top N

This commit is contained in:
Herbert Wolverson
2025-01-31 15:02:26 -06:00
parent 3787f718a4
commit 81b37893ff
2 changed files with 6 additions and 1 deletions

View File

@@ -121,6 +121,9 @@ export function topNTableHeader() {
export function topNTableRow(r) {
let row = document.createElement("tr");
row.classList.add("small");
let opacity = (10.0 - r.lastSeen) / 10.0;
//console.log(opacity, r.lastSeen);
row.style.opacity = opacity.toFixed(1);
if (r.circuit_id !== "") {
let td = document.createElement("td");

View File

@@ -40,7 +40,9 @@ export class TimedCache {
// Map to only have the value
entries = entries.map((v) => {
return v.value;
let x = v.value;
x.lastSeen = (Date.now() - v.lastSeen) / 1000;
return x;
});
// Return the top 10