mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 01:48:40 +00:00
chore: generate
This commit is contained in:
parent
24c70ec974
commit
1c76587ce2
3 changed files with 24 additions and 13 deletions
|
|
@ -376,10 +376,15 @@ function ModelUsageSection(props: { data: ModelUsagePoint[] }) {
|
|||
function ModelUsersSection(props: { data: ModelUsagePoint[] }) {
|
||||
return (
|
||||
<section id="users" data-section="model-panel">
|
||||
<SectionTitle title="Unique Users" description="Daily unique OpenCode Go users over the recent two-month window." />
|
||||
<SectionTitle
|
||||
title="Unique Users"
|
||||
description="Daily unique OpenCode Go users over the recent two-month window."
|
||||
/>
|
||||
<Show
|
||||
when={props.data.some((item) => item.users > 0)}
|
||||
fallback={<ModelEmptyState title="No user data" description="No user-bearing rows landed in the current window." />}
|
||||
fallback={
|
||||
<ModelEmptyState title="No user data" description="No user-bearing rows landed in the current window." />
|
||||
}
|
||||
>
|
||||
<ModelColumnChart data={props.data} metric="users" ariaLabel="Daily unique user chart" />
|
||||
</Show>
|
||||
|
|
@ -387,11 +392,7 @@ function ModelUsersSection(props: { data: ModelUsagePoint[] }) {
|
|||
)
|
||||
}
|
||||
|
||||
function ModelColumnChart(props: {
|
||||
data: ModelUsagePoint[]
|
||||
metric: "tokens" | "users"
|
||||
ariaLabel: string
|
||||
}) {
|
||||
function ModelColumnChart(props: { data: ModelUsagePoint[]; metric: "tokens" | "users"; ariaLabel: string }) {
|
||||
const [activeIndex, setActiveIndex] = createSignal<number>()
|
||||
const max = createMemo(() => Math.max(0, ...props.data.map((item) => modelUsageMetricValue(item, props.metric))) || 1)
|
||||
const activePoint = createMemo(() => {
|
||||
|
|
@ -458,9 +459,11 @@ function ModelColumnChart(props: {
|
|||
>
|
||||
<div
|
||||
data-slot="model-usage-bar"
|
||||
style={{
|
||||
"--model-usage-fill": `${modelUsageHeight(modelUsageMetricValue(point, props.metric), max())}%`,
|
||||
} as JSX.CSSProperties}
|
||||
style={
|
||||
{
|
||||
"--model-usage-fill": `${modelUsageHeight(modelUsageMetricValue(point, props.metric), max())}%`,
|
||||
} as JSX.CSSProperties
|
||||
}
|
||||
/>
|
||||
<Show when={activeIndex() === index() && activePoint()}>
|
||||
{(active) => (
|
||||
|
|
|
|||
|
|
@ -1578,7 +1578,10 @@
|
|||
left: auto;
|
||||
}
|
||||
|
||||
[data-page="stats"] :is([data-section="top-models"], [data-section="unique-users"]) [data-component="chart-tooltip"] strong,
|
||||
[data-page="stats"]
|
||||
:is([data-section="top-models"], [data-section="unique-users"])
|
||||
[data-component="chart-tooltip"]
|
||||
strong,
|
||||
[data-page="stats"]
|
||||
:is([data-section="top-models"], [data-section="unique-users"])
|
||||
[data-component="chart-tooltip"]
|
||||
|
|
@ -1589,7 +1592,10 @@
|
|||
white-space: nowrap;
|
||||
}
|
||||
|
||||
[data-page="stats"] :is([data-section="top-models"], [data-section="unique-users"]) [data-component="chart-tooltip"] strong {
|
||||
[data-page="stats"]
|
||||
:is([data-section="top-models"], [data-section="unique-users"])
|
||||
[data-component="chart-tooltip"]
|
||||
strong {
|
||||
padding: 8px 8px 0;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -791,7 +791,9 @@ function UniqueUsersSection(props: { data: StatsHomeData["users"] }) {
|
|||
<SectionTitle title="Unique Users" description="Daily unique OpenCode Go users by model." />
|
||||
<Show
|
||||
when={data().some((item) => usageTotal(item) > 0)}
|
||||
fallback={<EmptyState title="No user data" description="No user-bearing model_stat rows matched this window." />}
|
||||
fallback={
|
||||
<EmptyState title="No user data" description="No user-bearing model_stat rows matched this window." />
|
||||
}
|
||||
>
|
||||
<TopModelsChart
|
||||
data={data()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue