mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-09 22:18:28 +00:00
This commit is contained in:
parent
49593c1ec4
commit
7d204b5b57
2 changed files with 8 additions and 1 deletions
|
|
@ -330,7 +330,7 @@ function CatalogDatum(props: { label: string; value: string }) {
|
||||||
function ModelOverview(props: { data: StatsModelData | null }) {
|
function ModelOverview(props: { data: StatsModelData | null }) {
|
||||||
return (
|
return (
|
||||||
<section data-section="model-panel">
|
<section data-section="model-panel">
|
||||||
<SectionTitle title="Overview" description="Recent OpenCode Go tokens, sessions, and market position." />
|
<SectionTitle title="Overview" description="Recent OpenCode Go tokens, unique users, and market position." />
|
||||||
<Show
|
<Show
|
||||||
when={props.data}
|
when={props.data}
|
||||||
fallback={
|
fallback={
|
||||||
|
|
@ -340,6 +340,11 @@ function ModelOverview(props: { data: StatsModelData | null }) {
|
||||||
{(data) => (
|
{(data) => (
|
||||||
<div data-component="model-metric-grid">
|
<div data-component="model-metric-grid">
|
||||||
<MetricCard label="Tokens" value={formatTokens(data().totals.tokens)} detail="last two months" />
|
<MetricCard label="Tokens" value={formatTokens(data().totals.tokens)} detail="last two months" />
|
||||||
|
<MetricCard
|
||||||
|
label="Unique Users"
|
||||||
|
value={formatUsers(data().totals.uniqueUsers)}
|
||||||
|
detail="last two months"
|
||||||
|
/>
|
||||||
<MetricCard label="Sessions" value={formatInteger(data().totals.sessions)} detail="completed sessions" />
|
<MetricCard label="Sessions" value={formatInteger(data().totals.sessions)} detail="completed sessions" />
|
||||||
<MetricCard
|
<MetricCard
|
||||||
label="Token Share"
|
label="Token Share"
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ export type StatsModelData = {
|
||||||
tokenChange: number
|
tokenChange: number
|
||||||
totals: {
|
totals: {
|
||||||
sessions: number
|
sessions: number
|
||||||
|
uniqueUsers: number
|
||||||
tokens: number
|
tokens: number
|
||||||
cost: number
|
cost: number
|
||||||
tokensPerSession: number
|
tokensPerSession: number
|
||||||
|
|
@ -381,6 +382,7 @@ function buildStatsModelData(
|
||||||
tokenChange: percentChange(current.totalTokens, previous.totalTokens),
|
tokenChange: percentChange(current.totalTokens, previous.totalTokens),
|
||||||
totals: {
|
totals: {
|
||||||
sessions: current.sessions,
|
sessions: current.sessions,
|
||||||
|
uniqueUsers: current.uniqueUsers,
|
||||||
tokens: current.totalTokens,
|
tokens: current.totalTokens,
|
||||||
cost: round(microcentsToDollars(current.totalCostMicrocents), 2),
|
cost: round(microcentsToDollars(current.totalCostMicrocents), 2),
|
||||||
tokensPerSession: current.sessions > 0 ? Math.round(current.totalTokens / current.sessions) : 0,
|
tokensPerSession: current.sessions > 0 ? Math.round(current.totalTokens / current.sessions) : 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue