mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Merge branch 'dev' into project
This commit is contained in:
commit
3cc5b96dfc
9 changed files with 26 additions and 16 deletions
1
STATS.md
1
STATS.md
|
|
@ -65,3 +65,4 @@
|
|||
| 2025-08-29 | 256,045 (+3,249) | 211,075 (+5,833) | 467,120 (+9,082) |
|
||||
| 2025-08-30 | 258,863 (+2,818) | 212,397 (+1,322) | 471,260 (+4,140) |
|
||||
| 2025-08-31 | 262,004 (+3,141) | 213,944 (+1,547) | 475,948 (+4,688) |
|
||||
| 2025-09-01 | 265,359 (+3,355) | 215,115 (+1,171) | 480,474 (+4,526) |
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ export const getActor = query(async (): Promise<Actor.Info> => {
|
|||
}
|
||||
}
|
||||
const workspaceHint = splits[1]
|
||||
const accounts = Object.keys(auth.data.account)
|
||||
const accounts = Object.keys(auth.data.account ?? {})
|
||||
const result = await Database.transaction(async (tx) => {
|
||||
return await tx
|
||||
.select({
|
||||
|
|
|
|||
|
|
@ -20,4 +20,6 @@ export default createHandler(() => (
|
|||
</html>
|
||||
)}
|
||||
/>
|
||||
))
|
||||
), {
|
||||
mode: "sync",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
import type { APIEvent } from "@solidjs/start/server"
|
||||
import { Resource } from "@opencode/cloud-resource"
|
||||
import { json } from "@solidjs/router"
|
||||
import { Database } from "@opencode/cloud-core/drizzle/index.js"
|
||||
import { UserTable } from "@opencode/cloud-core/schema/user.sql.js"
|
||||
|
||||
export async function GET(evt: APIEvent) {
|
||||
return json({
|
||||
data: Resource.Database.host,
|
||||
data: await Database.use(async (tx) => {
|
||||
const result = await tx.$count(UserTable)
|
||||
return result
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ const logout = action(async () => {
|
|||
})
|
||||
|
||||
export default function WorkspaceLayout(props: RouteSectionProps) {
|
||||
const userInfo = createAsync(() => getUserInfo())
|
||||
const userInfo = createAsync(() => getUserInfo(), {
|
||||
deferStream: true,
|
||||
})
|
||||
return (
|
||||
<main data-page="workspace">
|
||||
<header data-component="workspace-header">
|
||||
|
|
@ -40,9 +42,7 @@ export default function WorkspaceLayout(props: RouteSectionProps) {
|
|||
</a>
|
||||
</div>
|
||||
<div data-slot="header-actions">
|
||||
{userInfo() &&
|
||||
<span>{userInfo()!.user.email}</span>
|
||||
}
|
||||
<span>{userInfo()?.user.email}</span>
|
||||
<form action={logout} method="post">
|
||||
<button type="submit" formaction={logout}>Logout</button>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -63,13 +63,14 @@ const createPortalUrl = action(async (returnUrl: string) => {
|
|||
return withActor(() => Billing.generatePortalUrl({ returnUrl }))
|
||||
}, "portalUrl")
|
||||
|
||||
export default function() {
|
||||
const actor = createAsync(() => getActor())
|
||||
export default function () {
|
||||
|
||||
/////////////////
|
||||
// Keys section
|
||||
/////////////////
|
||||
const keys = createAsync(() => listKeys())
|
||||
const keys = createAsync(() => listKeys(), {
|
||||
deferStream: true,
|
||||
})
|
||||
const createKeyAction = useAction(createKey)
|
||||
const removeKeyAction = useAction(removeKey)
|
||||
const createKeySubmission = useSubmission(createKey)
|
||||
|
|
@ -157,7 +158,9 @@ export default function() {
|
|||
/////////////////
|
||||
// Billing section
|
||||
/////////////////
|
||||
const billingInfo = createAsync(() => getBillingInfo())
|
||||
const billingInfo = createAsync(() => getBillingInfo(), {
|
||||
deferStream: true,
|
||||
})
|
||||
const createCheckoutUrlAction = useAction(createCheckoutUrl)
|
||||
const createCheckoutUrlSubmission = useSubmission(createCheckoutUrl)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ const init = () => {
|
|||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
max: 1,
|
||||
max: 6,
|
||||
})
|
||||
return drizzle(client, {})
|
||||
}
|
||||
|
||||
const createClient = "NODE_ENV" in process.env ? memo(init) : init
|
||||
const createClient = init
|
||||
|
||||
import { PgTransaction, type PgTransactionConfig } from "drizzle-orm/pg-core"
|
||||
import type { ExtractTablesWithRelations } from "drizzle-orm"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export const database = new sst.Linkable("Database", {
|
|||
database: "postgres",
|
||||
username: DATABASE_USERNAME.value,
|
||||
password: DATABASE_PASSWORD.value,
|
||||
port: 5432,
|
||||
port: 6432,
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ export namespace LSPServer {
|
|||
}
|
||||
|
||||
export const Gopls: Info = {
|
||||
id: "golang",
|
||||
id: "gopls",
|
||||
root: async (file) => {
|
||||
const work = await NearestRoot(["go.work"])(file)
|
||||
if (work) return work
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue