feat(ui): 添加外部服务配置面板 (ServicesPanel)

- 新增 ServicesPanel 组件,用于配置 Tavily 等第三方服务的 API Key
- 添加 Services API 客户端方法 (listServices, updateService, deleteService)
- 在工具栏菜单中添加 "External Services" 入口
- 支持 API Key 的配置、启用/禁用和删除
This commit is contained in:
2025-12-30 14:34:32 +08:00
parent c3db79c00d
commit 4108b112f9
5 changed files with 528 additions and 1 deletions
+6
View File
@@ -13,6 +13,7 @@ import {
AgentsPanel,
CheckpointPanel,
ProvidersPanel,
ServicesPanel,
LSPPanel,
DiagnosticsPanel,
SessionPanel,
@@ -37,6 +38,7 @@ export function App() {
const [showAgents, setShowAgents] = useState(false);
const [showCheckpoints, setShowCheckpoints] = useState(false);
const [showProviders, setShowProviders] = useState(false);
const [showServices, setShowServices] = useState(false);
const [showLSP, setShowLSP] = useState(false);
const [showDiagnostics, setShowDiagnostics] = useState(false);
const [showSessions, setShowSessions] = useState(false);
@@ -194,6 +196,7 @@ export function App() {
onOpenAgents={() => setShowAgents(true)}
onOpenCheckpoints={() => setShowCheckpoints(true)}
onOpenProviders={() => setShowProviders(true)}
onOpenServices={() => setShowServices(true)}
onOpenLSP={() => setShowLSP(true)}
onOpenDiagnostics={() => setShowDiagnostics(true)}
onOpenSessions={() => setShowSessions(true)}
@@ -236,6 +239,9 @@ export function App() {
{/* Providers 面板 */}
{showProviders && <ProvidersPanel onClose={() => setShowProviders(false)} responsive />}
{/* Services 面板 */}
{showServices && <ServicesPanel onClose={() => setShowServices(false)} responsive />}
{/* LSP 面板 */}
{showLSP && (
<LSPPanel
+4 -1
View File
@@ -3,7 +3,7 @@
*/
import { useEffect, useRef } from 'react';
import { MessageSquare, Terminal, Plug, Zap, Bot, History, Server, MessagesSquare } from 'lucide-react';
import { MessageSquare, Terminal, Plug, Zap, Bot, History, Server, MessagesSquare, Globe } from 'lucide-react';
import { motion, AnimatePresence } from 'framer-motion';
import { toast } from 'sonner';
import {
@@ -33,6 +33,7 @@ interface ChatPageProps {
onOpenAgents?: () => void;
onOpenCheckpoints?: () => void;
onOpenProviders?: () => void;
onOpenServices?: () => void;
onOpenLSP?: () => void;
onOpenDiagnostics?: () => void;
onOpenSessions?: () => void;
@@ -61,6 +62,7 @@ export function ChatPage({
onOpenAgents,
onOpenCheckpoints,
onOpenProviders,
onOpenServices,
onOpenLSP,
onOpenDiagnostics,
onOpenSessions,
@@ -197,6 +199,7 @@ export function ChatPage({
items={[
{ icon: History, label: 'Checkpoints', onClick: onOpenCheckpoints },
{ icon: Server, label: 'Model Providers', onClick: onOpenProviders },
{ icon: Globe, label: 'External Services', onClick: onOpenServices },
{ icon: Bot, label: 'Agent Presets', onClick: onOpenAgents },
{ icon: Zap, label: 'Hooks', onClick: onOpenHooks },
{ icon: Plug, label: 'MCP Servers', onClick: onOpenMCP },