summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-02-22 22:20:00 -0500
committerFrank <[email protected]>2026-02-22 22:20:00 -0500
commita5a70fa05bd62060f433cf26e0885a19b0e1a72e (patch)
treea48a14110b683c911bfc886257d27ff465f68f63
parent5596775c35fbf92b7e83729deed4ec8e286ab3ab (diff)
downloadopencode-a5a70fa05bd62060f433cf26e0885a19b0e1a72e.tar.gz
opencode-a5a70fa05bd62060f433cf26e0885a19b0e1a72e.zip
wip: zen lite
-rw-r--r--packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx
index c7ca496e6..5326306e2 100644
--- a/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx
+++ b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx
@@ -5,7 +5,8 @@ import { Billing } from "@opencode-ai/console-core/billing.js"
import { Database, eq, and, isNull, sql } from "@opencode-ai/console-core/drizzle/index.js"
import { BillingTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js"
import { Actor } from "@opencode-ai/console-core/actor.js"
-import { Subscription } from "@opencode-ai/console-core/black.js"
+import { Subscription } from "@opencode-ai/console-core/subscription.js"
+import { BlackData } from "@opencode-ai/console-core/black.js"
import { withActor } from "~/context/auth.withActor"
import { queryBillingInfo } from "../../common"
import styles from "./black-section.module.css"
@@ -31,17 +32,19 @@ const querySubscription = query(async (workspaceID: string) => {
.then((r) => r[0]),
)
if (!row?.subscription) return null
+ const blackData = BlackData.getLimits({ plan: row.subscription.plan })
return {
plan: row.subscription.plan,
useBalance: row.subscription.useBalance ?? false,
rollingUsage: Subscription.analyzeRollingUsage({
- plan: row.subscription.plan,
+ limit: blackData.rollingLimit,
+ window: blackData.rollingWindow,
usage: row.rollingUsage ?? 0,
timeUpdated: row.timeRollingUpdated ?? new Date(),
}),
weeklyUsage: Subscription.analyzeWeeklyUsage({
- plan: row.subscription.plan,
+ limit: blackData.fixedLimit,
usage: row.fixedUsage ?? 0,
timeUpdated: row.timeFixedUpdated ?? new Date(),
}),