feat(app): add 'connect provider' button to the manage models dialog (#10887)

This commit is contained in:
Alex Yaroshuk
2026-01-28 07:26:15 +08:00
committed by GitHub
parent df7f9ae3f4
commit 15ffd3cba1

View File

@@ -1,16 +1,33 @@
import { Dialog } from "@opencode-ai/ui/dialog" import { Dialog } from "@opencode-ai/ui/dialog"
import { List } from "@opencode-ai/ui/list" import { List } from "@opencode-ai/ui/list"
import { Switch } from "@opencode-ai/ui/switch" import { Switch } from "@opencode-ai/ui/switch"
import { Button } from "@opencode-ai/ui/button"
import type { Component } from "solid-js" import type { Component } from "solid-js"
import { useLocal } from "@/context/local" import { useLocal } from "@/context/local"
import { popularProviders } from "@/hooks/use-providers" import { popularProviders } from "@/hooks/use-providers"
import { useLanguage } from "@/context/language" import { useLanguage } from "@/context/language"
import { useDialog } from "@opencode-ai/ui/context/dialog"
import { DialogSelectProvider } from "./dialog-select-provider"
export const DialogManageModels: Component = () => { export const DialogManageModels: Component = () => {
const local = useLocal() const local = useLocal()
const language = useLanguage() const language = useLanguage()
const dialog = useDialog()
const handleConnectProvider = () => {
dialog.show(() => <DialogSelectProvider />)
}
return ( return (
<Dialog title={language.t("dialog.model.manage")} description={language.t("dialog.model.manage.description")}> <Dialog
title={language.t("dialog.model.manage")}
description={language.t("dialog.model.manage.description")}
action={
<Button class="h-7 -my-1 text-14-medium" icon="plus-small" tabIndex={-1} onClick={handleConnectProvider}>
{language.t("command.provider.connect")}
</Button>
}
>
<List <List
search={{ placeholder: language.t("dialog.model.search.placeholder"), autofocus: true }} search={{ placeholder: language.t("dialog.model.search.placeholder"), autofocus: true }}
emptyMessage={language.t("dialog.model.empty")} emptyMessage={language.t("dialog.model.empty")}