diff options
| author | Dax Raad <[email protected]> | 2025-09-03 13:17:32 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-09-03 13:17:32 -0400 |
| commit | 1e4f5710aaac7cfa071cc6ad83ceca6e09463623 (patch) | |
| tree | a1d37520b00b72f03cf527dfa7196bcdc4eee474 /cloud | |
| parent | 48a79b11738c3e55f25b49497b8ff78dfaee1222 (diff) | |
| download | opencode-1e4f5710aaac7cfa071cc6ad83ceca6e09463623.tar.gz opencode-1e4f5710aaac7cfa071cc6ad83ceca6e09463623.zip | |
wip: cloud
Diffstat (limited to 'cloud')
| -rw-r--r-- | cloud/app/src/routes/workspace/[id].tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cloud/app/src/routes/workspace/[id].tsx b/cloud/app/src/routes/workspace/[id].tsx index 85f4cc265..2e3f526c3 100644 --- a/cloud/app/src/routes/workspace/[id].tsx +++ b/cloud/app/src/routes/workspace/[id].tsx @@ -2,7 +2,7 @@ import "./[id].css" import { Billing } from "@opencode/cloud-core/billing.js" import { Key } from "@opencode/cloud-core/key.js" import { action, createAsync, query, useAction, useSubmission, json, useParams } from "@solidjs/router" -import { createSignal, For, Show } from "solid-js" +import { createMemo, createSignal, For, Show } from "solid-js" import { withActor } from "~/context/auth.withActor" import { IconCopy, IconCheck } from "~/component/icon" import { User } from "@opencode/cloud-core/user.js" @@ -335,22 +335,23 @@ export default function () { <tr> <th>Date</th> <th>Model</th> - <th>Tokens</th> + <th>Input</th> + <th>Output</th> <th>Cost</th> </tr> </thead> <tbody> <For each={billingInfo()!.usage}> {(usage) => { - const totalTokens = usage.inputTokens + usage.outputTokens + (usage.reasoningTokens || 0) - const date = new Date(usage.timeCreated) + const date = createMemo(() => new Date(usage.timeCreated)) return ( <tr> - <td data-slot="usage-date" title={formatDateUTC(date)}> - {formatDateForTable(date)} + <td data-slot="usage-date" title={formatDateUTC(date())}> + {formatDateForTable(date())} </td> <td data-slot="usage-model">{usage.model}</td> - <td data-slot="usage-tokens">{totalTokens.toLocaleString()}</td> + <td data-slot="usage-tokens">{usage.inputTokens}</td> + <td data-slot="usage-tokens">{usage.outputTokens}</td> <td data-slot="usage-cost">${((usage.cost ?? 0) / 100000000).toFixed(4)}</td> </tr> ) |
