varaverk: memory top procs — top 3, inline right of total on same line

This commit is contained in:
Gmer4Lfe
2026-05-24 11:28:51 -04:00
parent 397ec405a0
commit 3c26f8d767
2 changed files with 6 additions and 6 deletions
@@ -155,7 +155,7 @@ function vv_memory_breakdown(): array {
}
arsort($grouped);
$topProcs = [];
foreach (array_slice($grouped, 0, 5, true) as $name => $kb)
foreach (array_slice($grouped, 0, 3, true) as $name => $kb)
$topProcs[] = ['name' => $name, 'kb' => $kb];
return [
@@ -262,14 +262,14 @@ function vvRenderMemory(mem) {
const procs = mem.top_procs ?? [];
const procStrip = procs.map(p =>
`<span style="white-space:nowrap;color:#888;font-size:10px;">${p.name}&nbsp;<span style="color:#aaa;font-weight:600;">${vvFmtGib(p.kb)}</span></span>`
).join('<span style="color:#333;margin:0 6px;">·</span>');
`<span style="white-space:nowrap;">${p.name}&nbsp;<span style="color:#aaa;font-weight:600;">${vvFmtGib(p.kb)}</span></span>`
).join('<span style="color:#333;margin:0 5px;">·</span>');
let html = `<div style="margin-bottom:6px;">
<div style="font-size:14px;font-weight:600;color:${totalColor};margin-bottom:5px;">
let html = `<div style="display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px;">
<div style="font-size:14px;font-weight:600;color:${totalColor};white-space:nowrap;">
${vvFmtGib(usedKb)} <span style="font-size:11px;color:#555;font-weight:400;">/ ${vvFmtGib(total)}</span>
</div>
<div style="font-size:10px;color:#666;flex-wrap:wrap;line-height:1.8;">${procStrip}</div>
<div style="font-size:10px;color:#666;text-align:right;margin-left:10px;">${procStrip}</div>
</div>`;
html += vvMemRow('System', mem.system_kb ?? 0, total, VV_MEM_COLORS.system)
+ vvMemRow('VM', mem.vm_kb ?? 0, total, VV_MEM_COLORS.vm)