Live page: online peers only

This commit is contained in:
Daniel Redetzke
2026-10-05 14:34:08 +03:00
parent e01b73d677
commit 5850f3976e
2 changed files with 1 additions and 4 deletions
-1
View File
@@ -399,7 +399,6 @@ tr.idle td { color: var(--ink-3); }
tr.idle .spark polyline { stroke: var(--ink-3); } tr.idle .spark polyline { stroke: var(--ink-3); }
tr.idle .spark .fill { fill: var(--ink-3); } tr.idle .spark .fill { fill: var(--ink-3); }
td .mono, td.num .mono { font-variant-numeric: tabular-nums; } td .mono, td.num .mono { font-variant-numeric: tabular-nums; }
.liveoff { margin: 0; padding: 12px; font-size: 13px; color: var(--ink-3); }
.livesub { display: flex; align-items: center; gap: 6px; } .livesub { display: flex; align-items: center; gap: 6px; }
.dot.pulse { animation: pulse 2s ease-in-out infinite; } .dot.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } } @keyframes pulse { 50% { opacity: .35; } }
+1 -3
View File
@@ -1206,7 +1206,6 @@
const online = peers.filter((p) => p.stats.online) const online = peers.filter((p) => p.stats.online)
.map((p) => ({ p, r: last[p.id] || [0, 0], hist: pts.map((x) => { const v = x.peers[p.id]; return v ? v[0] + v[1] : 0; }) })) .map((p) => ({ p, r: last[p.id] || [0, 0], hist: pts.map((x) => { const v = x.peers[p.id]; return v ? v[0] + v[1] : 0; }) }))
.sort((a, b) => (b.r[0] + b.r[1]) - (a.r[0] + a.r[1]) || a.p.name.localeCompare(b.p.name)); .sort((a, b) => (b.r[0] + b.r[1]) - (a.r[0] + a.r[1]) || a.p.name.localeCompare(b.p.name));
const offline = peers.filter((p) => !p.stats.online);
const rate = (v, idle) => idle ? h('span', { class: 'muted' }, '–') : h('span', { class: 'mono' }, fmtRate(v)); const rate = (v, idle) => idle ? h('span', { class: 'muted' }, '–') : h('span', { class: 'mono' }, fmtRate(v));
rows.replaceChildren( rows.replaceChildren(
online.length ? h('div', { class: 'tbl' }, h('table', { class: 'narrow' }, online.length ? h('div', { class: 'tbl' }, h('table', { class: 'narrow' },
@@ -1220,8 +1219,7 @@
h('td', { class: 'num' }, rate(r[1], idle)), h('td', { class: 'num' }, rate(r[1], idle)),
h('td', null, h('span', { class: 'mono' }, p.stats.endpoint ? p.stats.endpoint.replace(/:\d+$/, '') : '–'), h('td', null, h('span', { class: 'mono' }, p.stats.endpoint ? p.stats.endpoint.replace(/:\d+$/, '') : '–'),
p.stats.location && p.stats.location.country ? h('span', { class: 'cc', title: fmtLocation(p.stats.location) }, p.stats.location.country) : null)); p.stats.location && p.stats.location.country ? h('span', { class: 'cc', title: fmtLocation(p.stats.location) }, p.stats.location.country) : null));
})))) : h('p', { class: 'empty' }, 'No peer is online.'), })))) : h('p', { class: 'empty' }, 'No peer is online.'));
offline.length ? h('p', { class: 'liveoff' }, 'Offline: ', offline.map((p, i) => [i ? ', ' : '', h('a', { href: '#/peers/' + p.id }, p.name)])) : null);
}; };
fill(wrap, fill(wrap,