feat(desktop): 集成 ServicesPanel 外部服务配置面板

- 添加 External Services 菜单入口
- 同步窗口权限配置到 capabilities schema
This commit is contained in:
2025-12-30 15:42:17 +08:00
parent 44bed99bb4
commit 1622872c55
3 changed files with 11 additions and 2 deletions
@@ -1 +1 @@
{"default":{"identifier":"default","description":"Default capabilities for the application","local":true,"windows":["*"],"permissions":["core:default","shell:default","fs:default","dialog:default",{"identifier":"http:default","allow":[{"url":"http://localhost:*/*"},{"url":"http://127.0.0.1:*/*"}]}]}} {"default":{"identifier":"default","description":"Default capabilities for the application","local":true,"windows":["*"],"permissions":["core:default","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-focus","core:window:allow-set-position","core:window:allow-set-size","core:window:allow-start-dragging","core:window:allow-is-visible","core:webview:allow-create-webview-window","shell:default","fs:default","dialog:default",{"identifier":"http:default","allow":[{"url":"http://localhost:*/*"},{"url":"http://127.0.0.1:*/*"}]}]}}
+6
View File
@@ -13,6 +13,7 @@ import {
AgentsPanel, AgentsPanel,
CheckpointPanel, CheckpointPanel,
ProvidersPanel, ProvidersPanel,
ServicesPanel,
LSPPanel, LSPPanel,
DiagnosticsPanel, DiagnosticsPanel,
SessionPanel, SessionPanel,
@@ -38,6 +39,7 @@ export function App() {
const [showAgents, setShowAgents] = useState(false); const [showAgents, setShowAgents] = useState(false);
const [showCheckpoints, setShowCheckpoints] = useState(false); const [showCheckpoints, setShowCheckpoints] = useState(false);
const [showProviders, setShowProviders] = useState(false); const [showProviders, setShowProviders] = useState(false);
const [showServices, setShowServices] = useState(false);
const [showLSP, setShowLSP] = useState(false); const [showLSP, setShowLSP] = useState(false);
const [showDiagnostics, setShowDiagnostics] = useState(false); const [showDiagnostics, setShowDiagnostics] = useState(false);
const [showSessions, setShowSessions] = useState(false); const [showSessions, setShowSessions] = useState(false);
@@ -218,6 +220,7 @@ export function App() {
onOpenAgents={() => setShowAgents(true)} onOpenAgents={() => setShowAgents(true)}
onOpenCheckpoints={() => setShowCheckpoints(true)} onOpenCheckpoints={() => setShowCheckpoints(true)}
onOpenProviders={() => setShowProviders(true)} onOpenProviders={() => setShowProviders(true)}
onOpenServices={() => setShowServices(true)}
onOpenLSP={() => setShowLSP(true)} onOpenLSP={() => setShowLSP(true)}
onOpenDiagnostics={() => setShowDiagnostics(true)} onOpenDiagnostics={() => setShowDiagnostics(true)}
onOpenSessions={() => setShowSessions(true)} onOpenSessions={() => setShowSessions(true)}
@@ -260,6 +263,9 @@ export function App() {
{/* Providers 面板 */} {/* Providers 面板 */}
{showProviders && <ProvidersPanel onClose={() => setShowProviders(false)} responsive />} {showProviders && <ProvidersPanel onClose={() => setShowProviders(false)} responsive />}
{/* Services 面板 */}
{showServices && <ServicesPanel onClose={() => setShowServices(false)} responsive />}
{/* LSP 面板 */} {/* LSP 面板 */}
{showLSP && ( {showLSP && (
<LSPPanel <LSPPanel
+4 -1
View File
@@ -3,7 +3,7 @@
*/ */
import { useEffect, useRef } from 'react'; 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 { motion, AnimatePresence } from 'framer-motion';
import { toast } from 'sonner'; import { toast } from 'sonner';
import { import {
@@ -33,6 +33,7 @@ interface ChatPageProps {
onOpenAgents?: () => void; onOpenAgents?: () => void;
onOpenCheckpoints?: () => void; onOpenCheckpoints?: () => void;
onOpenProviders?: () => void; onOpenProviders?: () => void;
onOpenServices?: () => void;
onOpenLSP?: () => void; onOpenLSP?: () => void;
onOpenDiagnostics?: () => void; onOpenDiagnostics?: () => void;
onOpenSessions?: () => void; onOpenSessions?: () => void;
@@ -61,6 +62,7 @@ export function ChatPage({
onOpenAgents, onOpenAgents,
onOpenCheckpoints, onOpenCheckpoints,
onOpenProviders, onOpenProviders,
onOpenServices,
onOpenLSP, onOpenLSP,
onOpenDiagnostics, onOpenDiagnostics,
onOpenSessions, onOpenSessions,
@@ -197,6 +199,7 @@ export function ChatPage({
items={[ items={[
{ icon: History, label: 'Checkpoints', onClick: onOpenCheckpoints }, { icon: History, label: 'Checkpoints', onClick: onOpenCheckpoints },
{ icon: Server, label: 'Model Providers', onClick: onOpenProviders }, { icon: Server, label: 'Model Providers', onClick: onOpenProviders },
{ icon: Globe, label: 'External Services', onClick: onOpenServices },
{ icon: Bot, label: 'Agent Presets', onClick: onOpenAgents }, { icon: Bot, label: 'Agent Presets', onClick: onOpenAgents },
{ icon: Zap, label: 'Hooks', onClick: onOpenHooks }, { icon: Zap, label: 'Hooks', onClick: onOpenHooks },
{ icon: Plug, label: 'MCP Servers', onClick: onOpenMCP }, { icon: Plug, label: 'MCP Servers', onClick: onOpenMCP },