agents table: show all-time spend instead of the resettable cycle counter

The agents table rendered the raw team spend field and labelled it 'Spend (30 days)', but that field is cycle-only and resets at budget_reset_at — for the agent teams, the 1st of the month. On 1 November both bot accounts therefore displayed as zeroed. It now prefers the all-time figure the portal supplies, and the label says what it shows.
This commit is contained in:
inference-bot committed 2026-11-01 17:16:35 +00:00
1 parent 4687efb369
commit 624c891a30
1 file changed
+4 -2
+4 -2
View File
@@ -700,7 +700,9 @@ function setMemberMode(mode) {
// Header label reflects the mode // Header label reflects the mode
$('spend-mode-label').textContent = mode === 'all' ? 'All-time spend' : 'Spend'; $('spend-mode-label').textContent = mode === 'all' ? 'All-time spend' : 'Spend';
const adminLabel = document.getElementById('spend-mode-label-admin'); const adminLabel = document.getElementById('spend-mode-label-admin');
if (adminLabel) adminLabel.textContent = mode === 'all' ? 'All-time spend' : 'Spend (30 days)'; // Agents always show all-time: their cycle counter resets on the 1st, so a cycle
// figure would read as zeroed for the co-op's own bot accounts every month.
if (adminLabel) adminLabel.textContent = 'All-time spend';
// Balance-only columns (Allowance/Credits/Remaining/Reset) hide in all-time mode // Balance-only columns (Allowance/Credits/Remaining/Reset) hide in all-time mode
$('table-members').parentElement.classList.toggle('members-all-time', mode === 'all'); $('table-members').parentElement.classList.toggle('members-all-time', mode === 'all');
const adminTable = document.getElementById('table-admins'); const adminTable = document.getElementById('table-admins');
@@ -798,7 +800,7 @@ function renderMembers() {
return '<tr>' + return '<tr>' +
'<td><strong>' + esc(a.name || a.alias) + '</strong></td>' + '<td><strong>' + esc(a.name || a.alias) + '</strong></td>' +
'<td><span class="pill manual" title="Agent account, not a member">' + esc(kind) + '</span></td>' + '<td><span class="pill manual" title="Agent account, not a member">' + esc(kind) + '</span></td>' +
'<td class="num">' + fmt(a.spend) + '</td>' + '<td class="num" title="All-time spend: agent accounts are billed monthly and their cycle counter resets on the 1st">' + fmt(a.all_time_spend ?? a.spend) + '</td>' +
'<td>' + budget + '</td>' + '<td>' + budget + '</td>' +
'</tr>'; '</tr>';
}).join(''); }).join('');