翻译为中文
Some checks are pending
Build Test / Build Test (${{ matrix.platform.name }}) (map[name:Linux os:ubuntu-latest rust-target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Build Test / Build Test (${{ matrix.platform.name }}) (map[name:Windows os:windows-latest rust-target:x86_64-pc-windows-msvc]) (push) Waiting to run
Build Test / Build Test (${{ matrix.platform.name }}) (map[name:macOS os:macos-latest rust-target:x86_64-apple-darwin]) (push) Waiting to run
Build Test / Build Test Summary (push) Blocked by required conditions

This commit is contained in:
2025-07-03 13:03:10 +08:00
parent ee565ac80f
commit 57dc05d49b
17 changed files with 346 additions and 346 deletions

View File

@@ -97,12 +97,12 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
*/
const handleAddStdioServer = async () => {
if (!stdioName.trim()) {
onError("Server name is required");
onError("服务器名称为必填项");
return;
}
if (!stdioCommand.trim()) {
onError("Command is required");
onError("命令为必填项");
return;
}
@@ -142,7 +142,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
onError(result.message);
}
} catch (error) {
onError("Failed to add server");
onError("添加服务器失败");
console.error("Failed to add stdio server:", error);
} finally {
setSaving(false);
@@ -154,12 +154,12 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
*/
const handleAddSseServer = async () => {
if (!sseName.trim()) {
onError("Server name is required");
onError("服务器名称为必填项");
return;
}
if (!sseUrl.trim()) {
onError("URL is required");
onError("URL 为必填项");
return;
}
@@ -195,7 +195,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
onError(result.message);
}
} catch (error) {
onError("Failed to add server");
onError("添加服务器失败");
console.error("Failed to add SSE server:", error);
} finally {
setSaving(false);
@@ -209,7 +209,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
return (
<div className="space-y-3">
<div className="flex items-center justify-between">
<Label className="text-sm font-medium">Environment Variables</Label>
<Label className="text-sm font-medium"></Label>
<Button
variant="outline"
size="sm"
@@ -217,7 +217,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
className="gap-2"
>
<Plus className="h-3 w-3" />
Add Variable
</Button>
</div>
@@ -257,9 +257,9 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
return (
<div className="p-6 space-y-6">
<div>
<h3 className="text-base font-semibold">Add MCP Server</h3>
<h3 className="text-base font-semibold"> MCP </h3>
<p className="text-sm text-muted-foreground mt-1">
Configure a new Model Context Protocol server
Model Context Protocol
</p>
</div>
@@ -280,7 +280,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
<Card className="p-6 space-y-6">
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="stdio-name">Server Name</Label>
<Label htmlFor="stdio-name"></Label>
<Input
id="stdio-name"
placeholder="my-server"
@@ -288,12 +288,12 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
onChange={(e) => setStdioName(e.target.value)}
/>
<p className="text-xs text-muted-foreground">
A unique name to identify this server
</p>
</div>
<div className="space-y-2">
<Label htmlFor="stdio-command">Command</Label>
<Label htmlFor="stdio-command"></Label>
<Input
id="stdio-command"
placeholder="/path/to/server"
@@ -302,12 +302,12 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
className="font-mono"
/>
<p className="text-xs text-muted-foreground">
The command to execute the server
</p>
</div>
<div className="space-y-2">
<Label htmlFor="stdio-args">Arguments (optional)</Label>
<Label htmlFor="stdio-args"></Label>
<Input
id="stdio-args"
placeholder="arg1 arg2 arg3"
@@ -316,19 +316,19 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
className="font-mono"
/>
<p className="text-xs text-muted-foreground">
Space-separated command arguments
</p>
</div>
<div className="space-y-2">
<Label htmlFor="stdio-scope">Scope</Label>
<Label htmlFor="stdio-scope"></Label>
<SelectComponent
value={stdioScope}
onValueChange={(value: string) => setStdioScope(value)}
options={[
{ value: "local", label: "Local (this project only)" },
{ value: "project", label: "Project (shared via .mcp.json)" },
{ value: "user", label: "User (all projects)" },
{ value: "local", label: "本地(仅限此项目)" },
{ value: "project", label: "项目(通过 .mcp.json 共享)" },
{ value: "user", label: "用户(所有项目)" },
]}
/>
</div>
@@ -345,12 +345,12 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
{saving ? (
<>
<Loader2 className="h-4 w-4 animate-spin" />
Adding Server...
...
</>
) : (
<>
<Plus className="h-4 w-4" />
Add Stdio Server
Stdio
</>
)}
</Button>
@@ -363,7 +363,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
<Card className="p-6 space-y-6">
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="sse-name">Server Name</Label>
<Label htmlFor="sse-name"></Label>
<Input
id="sse-name"
placeholder="sse-server"
@@ -371,7 +371,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
onChange={(e) => setSseName(e.target.value)}
/>
<p className="text-xs text-muted-foreground">
A unique name to identify this server
</p>
</div>
@@ -385,19 +385,19 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
className="font-mono"
/>
<p className="text-xs text-muted-foreground">
The SSE endpoint URL
SSE URL
</p>
</div>
<div className="space-y-2">
<Label htmlFor="sse-scope">Scope</Label>
<Label htmlFor="sse-scope"></Label>
<SelectComponent
value={sseScope}
onValueChange={(value: string) => setSseScope(value)}
options={[
{ value: "local", label: "Local (this project only)" },
{ value: "project", label: "Project (shared via .mcp.json)" },
{ value: "user", label: "User (all projects)" },
{ value: "local", label: "本地(仅限此项目)" },
{ value: "project", label: "项目(通过 .mcp.json 共享)" },
{ value: "user", label: "用户(所有项目)" },
]}
/>
</div>
@@ -414,12 +414,12 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
{saving ? (
<>
<Loader2 className="h-4 w-4 animate-spin" />
Adding Server...
...
</>
) : (
<>
<Plus className="h-4 w-4" />
Add SSE Server
SSE
</>
)}
</Button>
@@ -433,7 +433,7 @@ export const MCPAddServer: React.FC<MCPAddServerProps> = ({
<div className="space-y-3">
<div className="flex items-center gap-2 text-sm font-medium">
<Info className="h-4 w-4 text-primary" />
<span>Example Commands</span>
<span></span>
</div>
<div className="space-y-2 text-xs text-muted-foreground">
<div className="font-mono bg-background p-2 rounded">