mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-07 03:00:29 +00:00
feat(web): hide stages with no billing usage
The per-stage table on the run billing page now skips rows that have zero tokens and zero spend, since they add noise without information. Footer totals stay server-authoritative and are unaffected.
This commit is contained in:
parent
64a6eafe97
commit
77e5d06c4a
1 changed files with 9 additions and 1 deletions
|
|
@ -22,6 +22,14 @@ function isInFlight(stage: RunBillingStage): boolean {
|
||||||
return stage.state != null && IN_FLIGHT_STAGE_STATES.has(stage.state);
|
return stage.state != null && IN_FLIGHT_STAGE_STATES.has(stage.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hasBillableUsage(row: MappedStageRow): boolean {
|
||||||
|
return (
|
||||||
|
(row.inputTokens ?? 0) > 0 ||
|
||||||
|
(row.outputTokens ?? 0) > 0 ||
|
||||||
|
(row.totalUsdMicros ?? 0) > 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
interface MappedStageRow {
|
interface MappedStageRow {
|
||||||
stage: string;
|
stage: string;
|
||||||
model: string | null;
|
model: string | null;
|
||||||
|
|
@ -136,7 +144,7 @@ export default function RunBilling({ params }: { params: { id: string } }) {
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{rows.map((row) => (
|
{rows.filter(hasBillableUsage).map((row) => (
|
||||||
<tr key={row.stage} className="border-b border-line last:border-b-0">
|
<tr key={row.stage} className="border-b border-line last:border-b-0">
|
||||||
<td className="px-4 py-3 text-fg-2">{row.stage}</td>
|
<td className="px-4 py-3 text-fg-2">{row.stage}</td>
|
||||||
<td className="px-4 py-3 font-mono text-xs text-fg-3">
|
<td className="px-4 py-3 font-mono text-xs text-fg-3">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue