diff --git a/packages/console/app/src/component/icon.tsx b/packages/console/app/src/component/icon.tsx index ccf2dccf..fc27ef3b 100644 --- a/packages/console/app/src/component/icon.tsx +++ b/packages/console/app/src/component/icon.tsx @@ -118,3 +118,86 @@ export function IconWorkspaceLogo(props: JSX.SvgSVGAttributes) { ) } + +export function IconOpenAI(props: JSX.SvgSVGAttributes) { + return ( + + + + ) +} + +export function IconAnthropic(props: JSX.SvgSVGAttributes) { + return ( + + + + + ) +} + +export function IconXai(props: JSX.SvgSVGAttributes) { + return ( + + + + + ) +} + +export function IconAlibaba(props: JSX.SvgSVGAttributes) { + return ( + + + + ) +} + +export function IconMoonshotAI(props: JSX.SvgSVGAttributes) { + return ( + + + + ) +} + +export function IconZai(props: JSX.SvgSVGAttributes) { + return ( + + + + ) +} + +export function IconStealth(props: JSX.SvgSVGAttributes) { + return ( + + + + ) +} diff --git a/packages/console/app/src/routes/workspace/[id]/model-section.tsx b/packages/console/app/src/routes/workspace/[id]/model-section.tsx index 1740c9d3..6b8cc325 100644 --- a/packages/console/app/src/routes/workspace/[id]/model-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/model-section.tsx @@ -5,6 +5,17 @@ import { withActor } from "~/context/auth.withActor" import { ZenModel } 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" + +const getModelLab = (modelId: string) => { + if (modelId.startsWith("claude")) return "Anthropic" + if (modelId.startsWith("gpt")) return "OpenAI" + if (modelId.startsWith("kimi")) return "Moonshot AI" + if (modelId.startsWith("glm")) return "Z.ai" + if (modelId.startsWith("qwen")) return "Alibaba" + if (modelId.startsWith("grok")) return "xAI" + return "Stealth" +} const getModelsInfo = query(async (workspaceID: string) => { "use server" @@ -42,6 +53,15 @@ export function ModelSection() { const params = useParams() const modelsInfo = createAsync(() => getModelsInfo(params.id)) const userInfo = createAsync(() => querySessionInfo(params.id)) + + const modelsWithLab = createMemo(() => { + const info = modelsInfo() + if (!info) return [] + return info.all.map((model) => ({ + ...model, + lab: getModelLab(model.id), + })) + }) return (
@@ -57,17 +77,40 @@ export function ModelSection() { + + - - {({ id, name }) => { + + {({ id, name, lab }) => { const isEnabled = createMemo(() => !modelsInfo()!.disabled.includes(id)) return ( + +
Model Enabled
+ {(() => { + switch (lab) { + case "OpenAI": + return + case "Anthropic": + return + case "Moonshot AI": + return + case "Z.ai": + return + case "Alibaba": + return + case "xAI": + return + default: + return + } + })()} + {name}{lab}