charts: Money lives in one place, and the menus are concise
ci/woodpecker/push/woodpecker Pipeline was successful

Money was both a tab and a metric of Trends — two doors to one chart, which is
what "not consistent" looks like from the outside. The tab is gone; the metric
stays, and the nav is Members · Model usage · Trends.

Period wording now matches the dashboard exactly: 30 days · 90 days · All time.
Titles come from the shared module (Members · Requests · Spend · Money · Energy ·
Carbon), so both apps offer the same six options in the same order.
This commit is contained in:
inference-admin committed 2026-11-13 21:26:27 +00:00
1 parent 92de0c25f0
commit e7eb34d787
3 files changed
+8 -18

No files matched your search

+3 -13
View File
@@ -487,14 +487,13 @@ PAGE_HTML = """<!DOCTYPE html>
<button class="tab-btn active" id="tab-members" onclick="switchView('members')">Members</button>
<button class="tab-btn" id="tab-models" onclick="switchView('models')">Model usage</button>
<button class="tab-btn" id="tab-trends" onclick="switchView('trends')">Trends</button>
<button class="tab-btn" id="tab-money" onclick="showMoney()">Money</button>
<span class="range-group" id="member-mode-group">
<button class="range-btn active" id="mmode-balance" onclick="setMemberMode('balance')">Balance</button>
<button class="range-btn" id="mmode-all" onclick="setMemberMode('all')">All time</button>
</span>
<span class="range-group" id="range-group" style="display:none;">
<span class="range-label">Period</span>
<button class="range-btn" id="range-30" onclick="setRange(30)">Last 30 days</button>
<button class="range-btn" id="range-30" onclick="setRange(30)">30 days</button>
<button class="range-btn active" id="range-all" onclick="setRange(0)">All time</button>
</span>
</div>
@@ -565,8 +564,8 @@ PAGE_HTML = """<!DOCTYPE html>
</span>
<span class="range-group">
<span class="range-label">Period</span>
<button class="range-btn" id="tr-30" onclick="setTrendDays(30)">Last 30 days</button>
<button class="range-btn active" id="tr-90" onclick="setTrendDays(90)">Last 90 days</button>
<button class="range-btn" id="tr-30" onclick="setTrendDays(30)">30 days</button>
<button class="range-btn active" id="tr-90" onclick="setTrendDays(90)">90 days</button>
<button class="range-btn" id="tr-all" onclick="setTrendDays(0)">All time</button>
</span>
</div>
@@ -908,14 +907,6 @@ function clearArrows(table, sortState) {
});
}
// Money: a shortcut into Trends with the money metric selected — one chart
// area, one code path, the same chart the member dashboard draws.
function showMoney() {
buildMetricButtons();
switchView('trends');
setTrendMetric('money');
}
function switchView(view) {
currentView = view;
hideChartTip();
@@ -930,7 +921,6 @@ function switchView(view) {
$('tab-members').className = 'tab-btn' + (view === 'members' ? ' active' : '');
$('tab-models').className = 'tab-btn' + (view === 'models' ? ' active' : '');
$('tab-trends').className = 'tab-btn' + (view === 'trends' ? ' active' : '');
// Money is a metric of Trends, so its tab shows the Trends title.
$('view-title').textContent = view === 'members' ? 'Members' : (view === 'models' ? 'Model usage' : 'Trends');
// Mode groups: Balance/All-time for members; Period for models; the guest
// invite form belongs to the members view too.