feat: 添加云端开发环境页面,支持 Jump、Trae、Windsurf 等 IDE 链接

- 新增 cloud-env 页面,展示运行中的云端开发环境
- 支持 Web IDE、VS Code、Cursor、Trae、Windsurf、Antigravity 等 IDE 链接
- 添加复制功能和点击跳转功能
- 更新 WorkspaceDetailDialog,添加对应 IDE 选项
- 更新侧边栏导航,添加"云端环境"入口

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
xiongxiao
2026-03-21 00:13:13 +08:00
committed by cnb
parent ef08303182
commit 477826dcce
6 changed files with 399 additions and 40 deletions

View File

@@ -15,17 +15,18 @@ import type { WorkspaceOpen } from '../store'
import {
Code2,
Terminal,
Sparkles,
MousePointer2,
Box,
Lock,
Radio,
Bot,
Zap,
Copy,
Check,
Square,
Link
Link,
ExternalLink,
Wind,
Plane,
Rocket
} from 'lucide-react'
import { useEffect, useMemo, useState } from 'react'
import { toast } from 'sonner'
@@ -221,67 +222,74 @@ export function WorkspaceDetailDialog() {
workspaceSecretLink: state.workspaceSecretLink
})))
const linkItems: LinkItem[] = [
{
key: 'jumpUrl' as LinkItemKey,
label: 'Jump',
icon: <ExternalLink className="w-5 h-5" />,
order: 1,
getUrl: (data) => data.jumpUrl
},
{
key: 'webide' as LinkItemKey,
label: 'Web IDE',
icon: <Code2 className="w-5 h-5" />,
order: 1,
order: 2,
getUrl: (data) => data.webide
},
{
key: 'vscode' as LinkItemKey,
label: 'VS Code',
icon: <Code2 className="w-5 h-5" />,
order: 2,
order: 3,
getUrl: (data) => data.vscode
},
{
key: 'vscode-insiders' as LinkItemKey,
label: 'VS Code Insiders',
icon: <Sparkles className="w-5 h-5" />,
order: 5,
getUrl: (data) => data['vscode-insiders']
},
{
key: 'cursor' as LinkItemKey,
label: 'Cursor',
icon: <MousePointer2 className="w-5 h-5" />,
order: 6,
order: 4,
getUrl: (data) => data.cursor
},
{
key: 'jetbrains' as LinkItemKey,
label: 'JetBrains IDEs',
icon: <Box className="w-5 h-5" />,
key: 'trae-cn' as LinkItemKey,
label: 'Trae',
icon: <Rocket className="w-5 h-5" />,
order: 5,
getUrl: (data) => data['trae-cn']
},
{
key: 'windsurf' as LinkItemKey,
label: 'Windsurf',
icon: <Wind className="w-5 h-5" />,
order: 6,
getUrl: (data) => data.windsurf
},
{
key: 'antigravity' as LinkItemKey,
label: 'Antigravity',
icon: <Plane className="w-5 h-5" />,
order: 7,
getUrl: (data) => Object.values(data.jetbrains || {}).find(Boolean)
getUrl: (data) => data.antigravity
},
{
key: 'ssh' as LinkItemKey,
label: 'SSH',
icon: <Lock className="w-5 h-5" />,
order: 4,
order: 9,
getUrl: (data) => data.ssh
},
{
key: 'remoteSsh' as LinkItemKey,
label: 'Remote SSH',
icon: <Radio className="w-5 h-5" />,
order: 8,
order: 10,
getUrl: (data) => data.remoteSsh
},
{
key: 'codebuddy' as LinkItemKey,
label: 'CodeBuddy',
icon: <Bot className="w-5 h-5" />,
order: 9,
getUrl: (data) => data.codebuddy
},
{
key: 'codebuddycn' as LinkItemKey,
label: 'CodeBuddy CN',
label: 'CodeBuddy',
icon: <Zap className="w-5 h-5" />,
order: 3,
order: 11,
getUrl: (data) => data.codebuddycn
},
].sort((a, b) => (a.order || 0) - (b.order || 0))