This commit is contained in:
Frank
2025-10-11 16:17:39 -04:00
parent d32ec9bd52
commit 34e5b9bdb0

View File

@@ -10,9 +10,10 @@ const getModelsInfo = query(async (workspaceID: string) => {
"use server" "use server"
return withActor(async () => { return withActor(async () => {
return { return {
all: Object.keys(ZenModel.list()) all: Object.entries(ZenModel.list())
.filter((model) => !["claude-3-5-haiku", "qwen3-max"].includes(model)) .filter(([id, _model]) => !["claude-3-5-haiku", "qwen3-max"].includes(id))
.sort(([a], [b]) => a.localeCompare(b)), .sort(([_idA, modelA], [_idB, modelB]) => modelA.name.localeCompare(modelB.name))
.map(([id, model]) => ({ id, name: model.name })),
disabled: await Model.listDisabled(), disabled: await Model.listDisabled(),
} }
}, workspaceID) }, workspaceID)
@@ -62,14 +63,14 @@ export function ModelSection() {
</thead> </thead>
<tbody> <tbody>
<For each={modelsInfo()!.all}> <For each={modelsInfo()!.all}>
{(modelId) => { {({ id, name }) => {
const isEnabled = createMemo(() => !modelsInfo()!.disabled.includes(modelId)) const isEnabled = createMemo(() => !modelsInfo()!.disabled.includes(id))
return ( return (
<tr data-slot="model-row" data-disabled={!isEnabled()}> <tr data-slot="model-row" data-disabled={!isEnabled()}>
<td data-slot="model-name">{ZenModel.list()[modelId].name}</td> <td data-slot="model-name">{name}</td>
<td data-slot="model-toggle"> <td data-slot="model-toggle">
<form action={updateModel} method="post"> <form action={updateModel} method="post">
<input type="hidden" name="model" value={modelId} /> <input type="hidden" name="model" value={id} />
<input type="hidden" name="workspaceID" value={params.id} /> <input type="hidden" name="workspaceID" value={params.id} />
<input type="hidden" name="enabled" value={isEnabled().toString()} /> <input type="hidden" name="enabled" value={isEnabled().toString()} />
<label data-slot="model-toggle-label"> <label data-slot="model-toggle-label">