chore: generate
This commit is contained in:
@@ -376,10 +376,15 @@ function ModelUsageSection(props: { data: ModelUsagePoint[] }) {
|
|||||||
function ModelUsersSection(props: { data: ModelUsagePoint[] }) {
|
function ModelUsersSection(props: { data: ModelUsagePoint[] }) {
|
||||||
return (
|
return (
|
||||||
<section id="users" data-section="model-panel">
|
<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
|
<Show
|
||||||
when={props.data.some((item) => item.users > 0)}
|
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" />
|
<ModelColumnChart data={props.data} metric="users" ariaLabel="Daily unique user chart" />
|
||||||
</Show>
|
</Show>
|
||||||
@@ -387,11 +392,7 @@ function ModelUsersSection(props: { data: ModelUsagePoint[] }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function ModelColumnChart(props: {
|
function ModelColumnChart(props: { data: ModelUsagePoint[]; metric: "tokens" | "users"; ariaLabel: string }) {
|
||||||
data: ModelUsagePoint[]
|
|
||||||
metric: "tokens" | "users"
|
|
||||||
ariaLabel: string
|
|
||||||
}) {
|
|
||||||
const [activeIndex, setActiveIndex] = createSignal<number>()
|
const [activeIndex, setActiveIndex] = createSignal<number>()
|
||||||
const max = createMemo(() => Math.max(0, ...props.data.map((item) => modelUsageMetricValue(item, props.metric))) || 1)
|
const max = createMemo(() => Math.max(0, ...props.data.map((item) => modelUsageMetricValue(item, props.metric))) || 1)
|
||||||
const activePoint = createMemo(() => {
|
const activePoint = createMemo(() => {
|
||||||
@@ -458,9 +459,11 @@ function ModelColumnChart(props: {
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
data-slot="model-usage-bar"
|
data-slot="model-usage-bar"
|
||||||
style={{
|
style={
|
||||||
"--model-usage-fill": `${modelUsageHeight(modelUsageMetricValue(point, props.metric), max())}%`,
|
{
|
||||||
} as JSX.CSSProperties}
|
"--model-usage-fill": `${modelUsageHeight(modelUsageMetricValue(point, props.metric), max())}%`,
|
||||||
|
} as JSX.CSSProperties
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<Show when={activeIndex() === index() && activePoint()}>
|
<Show when={activeIndex() === index() && activePoint()}>
|
||||||
{(active) => (
|
{(active) => (
|
||||||
|
|||||||
@@ -1578,7 +1578,10 @@
|
|||||||
left: auto;
|
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"]
|
[data-page="stats"]
|
||||||
:is([data-section="top-models"], [data-section="unique-users"])
|
:is([data-section="top-models"], [data-section="unique-users"])
|
||||||
[data-component="chart-tooltip"]
|
[data-component="chart-tooltip"]
|
||||||
@@ -1589,7 +1592,10 @@
|
|||||||
white-space: nowrap;
|
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;
|
padding: 8px 8px 0;
|
||||||
font-weight: 500;
|
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." />
|
<SectionTitle title="Unique Users" description="Daily unique OpenCode Go users by model." />
|
||||||
<Show
|
<Show
|
||||||
when={data().some((item) => usageTotal(item) > 0)}
|
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
|
<TopModelsChart
|
||||||
data={data()}
|
data={data()}
|
||||||
|
|||||||
Reference in New Issue
Block a user