mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +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);
|
||||
}
|
||||
|
||||
function hasBillableUsage(row: MappedStageRow): boolean {
|
||||
return (
|
||||
(row.inputTokens ?? 0) > 0 ||
|
||||
(row.outputTokens ?? 0) > 0 ||
|
||||
(row.totalUsdMicros ?? 0) > 0
|
||||
);
|
||||
}
|
||||
|
||||
interface MappedStageRow {
|
||||
stage: string;
|
||||
model: string | null;
|
||||
|
|
@ -136,7 +144,7 @@ export default function RunBilling({ params }: { params: { id: string } }) {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map((row) => (
|
||||
{rows.filter(hasBillableUsage).map((row) => (
|
||||
<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 font-mono text-xs text-fg-3">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue