Pull partner token ledgers into a RAM cache so fleet totals are fleet-wide

This commit is contained in:
Gmer4Lfe
2026-08-04 18:14:38 -04:00
parent 969a85f303
commit 83508cfb1b
6 changed files with 289 additions and 39 deletions
+7 -1
View File
@@ -473,9 +473,15 @@ if (is_dir('/var/log/varaverk')) {
+ `<span class="vv-ai-hostrow-v">${num(tokData.all.total)}</span></div>`;
Object.keys(hosts).forEach(id => {
const x = hosts[id];
// Three states, not two. "synced" is a partner whose ledger ai_token_sync.sh pulled;
// "not collected here" is a partner we have never seen a ledger for. Collapsing the
// second into a zero would report the partner as idle when the truth is we cannot see it.
const tag = x.self ? ' · this host'
: x.synced ? ' · synced ' + ago(x.synced)
: '';
hh += `<div class="vv-ai-hostrow${tokScope === id ? ' active' : ''}" data-scope="${esc(id)}">`
+ `<span class="vv-ai-hostrow-n">${esc(x.name)}</span>`
+ `<span class="vv-ai-hostrow-h">${esc(id)}${x.self ? ' · this host' : ''}</span>`
+ `<span class="vv-ai-hostrow-h">${esc(id)}${tag}</span>`
+ (x.seen ? `<span class="vv-ai-hostrow-v">${num(x.all.total)}</span>`
: `<span class="vv-ai-hostrow-v none">not collected here</span>`)
+ `</div>`;