feat(ui): 集成 Provider 管理到 web 和 desktop 应用

- 新增 ProviderEditor 组件用于编辑提供商配置
- ProvidersPanel 添加编辑按钮集成 ProviderEditor
- ChatPage 添加 onOpenProviders 工具栏按钮
- web/desktop App.tsx 集成 ProvidersPanel 面板
This commit is contained in:
2025-12-13 02:01:09 +08:00
parent 6ec6fe2f9f
commit 26e8646518
7 changed files with 627 additions and 4 deletions
+6
View File
@@ -12,6 +12,7 @@ import {
HooksPanel,
AgentsPanel,
CheckpointPanel,
ProvidersPanel,
Toaster,
listSessions,
createSession,
@@ -29,6 +30,7 @@ export function App() {
const [showHooks, setShowHooks] = useState(false);
const [showAgents, setShowAgents] = useState(false);
const [showCheckpoints, setShowCheckpoints] = useState(false);
const [showProviders, setShowProviders] = useState(false);
const [sessionTitleUpdate, setSessionTitleUpdate] = useState<{ sessionId: string; name: string } | null>(null);
// 初始化:加载或创建会话
@@ -104,6 +106,7 @@ export function App() {
onOpenHooks={() => setShowHooks(true)}
onOpenAgents={() => setShowAgents(true)}
onOpenCheckpoints={() => setShowCheckpoints(true)}
onOpenProviders={() => setShowProviders(true)}
/>
) : (
<div className="flex-1 flex items-center justify-center h-full">
@@ -142,6 +145,9 @@ export function App() {
{/* Checkpoints 面板 */}
{showCheckpoints && <CheckpointPanel onClose={() => setShowCheckpoints(false)} />}
{/* Providers 面板 */}
{showProviders && <ProvidersPanel onClose={() => setShowProviders(false)} />}
{/* Toast 通知 */}
<Toaster />
</div>