mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-16 14:24:56 +01:00
chore: format code
This commit is contained in:
@@ -133,8 +133,7 @@ export function BillingSection() {
|
||||
<div data-slot="section-title">
|
||||
<h2>Billing</h2>
|
||||
<p>
|
||||
Manage payments methods. <a href="mailto:contact@anoma.ly">Contact us</a> if you have any
|
||||
questions.
|
||||
Manage payments methods. <a href="mailto:contact@anoma.ly">Contact us</a> if you have any questions.
|
||||
</p>
|
||||
</div>
|
||||
<div data-slot="section-content">
|
||||
@@ -164,32 +163,20 @@ export function BillingSection() {
|
||||
placeholder="Enter amount"
|
||||
/>
|
||||
<div data-slot="form-actions">
|
||||
<button
|
||||
data-color="ghost"
|
||||
type="button"
|
||||
onClick={() => hideAddBalanceForm()}
|
||||
>
|
||||
<button data-color="ghost" type="button" onClick={() => hideAddBalanceForm()}>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
data-color="primary"
|
||||
type="button"
|
||||
disabled={
|
||||
!store.addBalanceAmount ||
|
||||
checkoutSubmission.pending ||
|
||||
store.checkoutRedirecting
|
||||
}
|
||||
disabled={!store.addBalanceAmount || checkoutSubmission.pending || store.checkoutRedirecting}
|
||||
onClick={onClickCheckout}
|
||||
>
|
||||
{checkoutSubmission.pending || store.checkoutRedirecting
|
||||
? "Loading..."
|
||||
: "Add"}
|
||||
{checkoutSubmission.pending || store.checkoutRedirecting ? "Loading..." : "Add"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<Show
|
||||
when={checkoutSubmission.result && (checkoutSubmission.result as any).error}
|
||||
>
|
||||
<Show when={checkoutSubmission.result && (checkoutSubmission.result as any).error}>
|
||||
{(err: any) => <div data-slot="form-error">{err()}</div>}
|
||||
</Show>
|
||||
</div>
|
||||
@@ -210,10 +197,7 @@ export function BillingSection() {
|
||||
<div data-slot="card-details">
|
||||
<Switch>
|
||||
<Match when={billingInfo()?.paymentMethodType === "card"}>
|
||||
<Show
|
||||
when={billingInfo()?.paymentMethodLast4}
|
||||
fallback={<span data-slot="number">----</span>}
|
||||
>
|
||||
<Show when={billingInfo()?.paymentMethodLast4} fallback={<span data-slot="number">----</span>}>
|
||||
<span data-slot="secret">••••</span>
|
||||
<span data-slot="number">{billingInfo()?.paymentMethodLast4}</span>
|
||||
</Show>
|
||||
@@ -241,9 +225,7 @@ export function BillingSection() {
|
||||
disabled={checkoutSubmission.pending || store.checkoutRedirecting}
|
||||
onClick={onClickCheckout}
|
||||
>
|
||||
{checkoutSubmission.pending || store.checkoutRedirecting
|
||||
? "Loading..."
|
||||
: "Enable Billing"}
|
||||
{checkoutSubmission.pending || store.checkoutRedirecting ? "Loading..." : "Enable Billing"}
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
@@ -104,13 +104,9 @@ export function MonthlyLimitSection() {
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
<Show
|
||||
when={billingInfo()?.monthlyLimit}
|
||||
fallback={<p data-slot="usage-status">No usage limit set.</p>}
|
||||
>
|
||||
<Show when={billingInfo()?.monthlyLimit} fallback={<p data-slot="usage-status">No usage limit set.</p>}>
|
||||
<p data-slot="usage-status">
|
||||
Current usage for{" "}
|
||||
{new Date().toLocaleDateString("en-US", { month: "long", timeZone: "UTC" })} is $
|
||||
Current usage for {new Date().toLocaleDateString("en-US", { month: "long", timeZone: "UTC" })} is $
|
||||
{(() => {
|
||||
const dateLastUsed = billingInfo()?.timeMonthlyUsageUpdated
|
||||
if (!dateLastUsed) return "0"
|
||||
|
||||
@@ -89,10 +89,7 @@ export function PaymentSection() {
|
||||
<td data-slot="payment-receipt">
|
||||
<button
|
||||
onClick={async () => {
|
||||
const receiptUrl = await downloadReceiptAction(
|
||||
params.id,
|
||||
payment.paymentID!,
|
||||
)
|
||||
const receiptUrl = await downloadReceiptAction(params.id, payment.paymentID!)
|
||||
if (receiptUrl) {
|
||||
window.open(receiptUrl, "_blank")
|
||||
}
|
||||
|
||||
@@ -69,11 +69,7 @@ export function ReloadSection() {
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
if (
|
||||
!setReloadSubmission.pending &&
|
||||
setReloadSubmission.result &&
|
||||
!(setReloadSubmission.result as any).error
|
||||
) {
|
||||
if (!setReloadSubmission.pending && setReloadSubmission.result && !(setReloadSubmission.result as any).error) {
|
||||
setStore("show", false)
|
||||
}
|
||||
})
|
||||
@@ -108,8 +104,8 @@ export function ReloadSection() {
|
||||
}
|
||||
>
|
||||
<p>
|
||||
Auto reload is <b>enabled</b>. We'll reload <b>${billingInfo()?.reloadAmount}</b>{" "}
|
||||
(+$1.23 processing fee) when balance reaches <b>${billingInfo()?.reloadTrigger}</b>.
|
||||
Auto reload is <b>enabled</b>. We'll reload <b>${billingInfo()?.reloadAmount}</b> (+$1.23 processing fee)
|
||||
when balance reaches <b>${billingInfo()?.reloadTrigger}</b>.
|
||||
</p>
|
||||
</Show>
|
||||
<button data-color="primary" type="button" onClick={() => show()}>
|
||||
@@ -194,8 +190,8 @@ export function ReloadSection() {
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
})}
|
||||
. Reason: {billingInfo()?.reloadError?.replace(/\.$/, "")}. Please update your payment
|
||||
method and try again.
|
||||
. Reason: {billingInfo()?.reloadError?.replace(/\.$/, "")}. Please update your payment method and try
|
||||
again.
|
||||
</p>
|
||||
<form action={reload} method="post" data-slot="create-form">
|
||||
<input type="hidden" name="workspaceID" value={params.id} />
|
||||
|
||||
@@ -51,9 +51,7 @@ export default function () {
|
||||
disabled={checkoutSubmission.pending || store.checkoutRedirecting}
|
||||
onClick={onClickCheckout}
|
||||
>
|
||||
{checkoutSubmission.pending || store.checkoutRedirecting
|
||||
? "Loading..."
|
||||
: "Enable billing"}
|
||||
{checkoutSubmission.pending || store.checkoutRedirecting ? "Loading..." : "Enable billing"}
|
||||
</button>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -146,20 +146,14 @@ export function KeySection() {
|
||||
title="Copy API key"
|
||||
>
|
||||
<span>{key.keyDisplay}</span>
|
||||
<Show
|
||||
when={copied()}
|
||||
fallback={<IconCopy style={{ width: "14px", height: "14px" }} />}
|
||||
>
|
||||
<Show when={copied()} fallback={<IconCopy style={{ width: "14px", height: "14px" }} />}>
|
||||
<IconCheck style={{ width: "14px", height: "14px" }} />
|
||||
</Show>
|
||||
</button>
|
||||
</Show>
|
||||
</td>
|
||||
<td data-slot="key-user-email">{key.email}</td>
|
||||
<td
|
||||
data-slot="key-last-used"
|
||||
title={key.timeUsed ? formatDateUTC(key.timeUsed) : undefined}
|
||||
>
|
||||
<td data-slot="key-last-used" title={key.timeUsed ? formatDateUTC(key.timeUsed) : undefined}>
|
||||
{key.timeUsed ? formatDateForTable(key.timeUsed) : "-"}
|
||||
</td>
|
||||
<td data-slot="key-actions">
|
||||
|
||||
@@ -85,12 +85,7 @@ const updateMember = action(async (form: FormData) => {
|
||||
)
|
||||
}, "member.update")
|
||||
|
||||
function MemberRow(props: {
|
||||
member: any
|
||||
workspaceID: string
|
||||
actorID: string
|
||||
actorRole: string
|
||||
}) {
|
||||
function MemberRow(props: { member: any; workspaceID: string; actorID: string; actorRole: string }) {
|
||||
const submission = useSubmission(updateMember)
|
||||
const isCurrentUser = () => props.actorID === props.member.id
|
||||
const isAdmin = () => props.actorRole === "admin"
|
||||
|
||||
@@ -5,15 +5,7 @@ import { withActor } from "~/context/auth.withActor"
|
||||
import { ZenData } from "@opencode-ai/console-core/model.js"
|
||||
import styles from "./model-section.module.css"
|
||||
import { querySessionInfo } from "../common"
|
||||
import {
|
||||
IconAlibaba,
|
||||
IconAnthropic,
|
||||
IconMoonshotAI,
|
||||
IconOpenAI,
|
||||
IconStealth,
|
||||
IconXai,
|
||||
IconZai,
|
||||
} from "~/component/icon"
|
||||
import { IconAlibaba, IconAnthropic, IconMoonshotAI, IconOpenAI, IconStealth, IconXai, IconZai } from "~/component/icon"
|
||||
|
||||
const getModelLab = (modelId: string) => {
|
||||
if (modelId.startsWith("claude")) return "Anthropic"
|
||||
@@ -76,8 +68,7 @@ export function ModelSection() {
|
||||
<div data-slot="section-title">
|
||||
<h2>Models</h2>
|
||||
<p>
|
||||
Manage which models workspace members can access.{" "}
|
||||
<a href="/docs/zen#pricing ">Learn more</a>.
|
||||
Manage which models workspace members can access. <a href="/docs/zen#pricing ">Learn more</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div data-slot="models-list">
|
||||
|
||||
@@ -43,24 +43,15 @@ export function NewUserSection() {
|
||||
<div data-component="feature-grid">
|
||||
<div data-slot="feature">
|
||||
<h3>Tested & Verified Models</h3>
|
||||
<p>
|
||||
We've benchmarked and tested models specifically for coding agents to ensure the best
|
||||
performance.
|
||||
</p>
|
||||
<p>We've benchmarked and tested models specifically for coding agents to ensure the best performance.</p>
|
||||
</div>
|
||||
<div data-slot="feature">
|
||||
<h3>Highest Quality</h3>
|
||||
<p>
|
||||
Access models configured for optimal performance - no downgrades or routing to cheaper
|
||||
providers.
|
||||
</p>
|
||||
<p>Access models configured for optimal performance - no downgrades or routing to cheaper providers.</p>
|
||||
</div>
|
||||
<div data-slot="feature">
|
||||
<h3>No Lock-in</h3>
|
||||
<p>
|
||||
Use Zen with any coding agent, and continue using other providers with opencode
|
||||
whenever you want.
|
||||
</p>
|
||||
<p>Use Zen with any coding agent, and continue using other providers with opencode whenever you want.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -55,10 +55,7 @@ const listProviders = query(async (workspaceID: string) => {
|
||||
function ProviderRow(props: { provider: Provider }) {
|
||||
const params = useParams()
|
||||
const providers = createAsync(() => listProviders(params.id))
|
||||
const saveSubmission = useSubmission(
|
||||
saveProvider,
|
||||
([fd]) => fd.get("provider")?.toString() === props.provider.key,
|
||||
)
|
||||
const saveSubmission = useSubmission(saveProvider, ([fd]) => fd.get("provider")?.toString() === props.provider.key)
|
||||
const removeSubmission = useSubmission(
|
||||
removeProvider,
|
||||
([fd]) => fd.get("provider")?.toString() === props.provider.key,
|
||||
@@ -94,16 +91,9 @@ function ProviderRow(props: { provider: Provider }) {
|
||||
<td data-slot="provider-key">
|
||||
<Show
|
||||
when={store.editing}
|
||||
fallback={
|
||||
<span>{providerData() ? maskCredentials(providerData()!.credentials) : "-"}</span>
|
||||
}
|
||||
fallback={<span>{providerData() ? maskCredentials(providerData()!.credentials) : "-"}</span>}
|
||||
>
|
||||
<form
|
||||
id={`provider-form-${props.provider.key}`}
|
||||
action={saveProvider}
|
||||
method="post"
|
||||
data-slot="edit-form"
|
||||
>
|
||||
<form id={`provider-form-${props.provider.key}`} action={saveProvider} method="post" data-slot="edit-form">
|
||||
<div data-slot="input-wrapper">
|
||||
<input
|
||||
ref={(r) => (input = r)}
|
||||
|
||||
@@ -67,10 +67,7 @@ export const querySessionInfo = query(async (workspaceID: string) => {
|
||||
return withActor(() => {
|
||||
return {
|
||||
isAdmin: Actor.userRole() === "admin",
|
||||
isBeta:
|
||||
Resource.App.stage === "production"
|
||||
? workspaceID === "wrk_01K46JDFR0E75SG2Q8K172KF3Y"
|
||||
: true,
|
||||
isBeta: Resource.App.stage === "production" ? workspaceID === "wrk_01K46JDFR0E75SG2Q8K172KF3Y" : true,
|
||||
}
|
||||
}, workspaceID)
|
||||
}, "session.get")
|
||||
|
||||
Reference in New Issue
Block a user