feat: 实现本地工具版本检测功能

- AboutSection 组件调用 get_tool_versions 命令
- 自动检测 Claude Code、Codex、Gemini CLI 版本
- 显示安装状态和版本号
This commit is contained in:
coso
2025-12-15 13:20:49 +08:00
parent 2e6de831fa
commit c8abef58b8
14 changed files with 59 additions and 17 deletions
+14 -8
View File
@@ -53,19 +53,25 @@ ProxyCast 是一款基于 Tauri 2.0 + React 18 + Rust 构建的跨平台桌面
## 📸 界面截图
### Dashboard - 服务控制与 API 测试
![Dashboard](docs/images/289cfb0d-63bb-4d8a-b1bf-a2f10bbaacdb.png)
![Dashboard](docs/images/420984ac-8287-44c6-b209-bbffd59dc0eb.png)
### Provider 管理 - 凭证配置与切换
![Providers](docs/images/80084116-b822-4aa3-821a-bcfb8864189a.png)
### 凭证池 - 多凭证管理
![Provider Pool](docs/images/44dfe29b-ef1e-4fab-82cc-8fbb3d5ae673.png)
### 模型列表 - 可用模型查看
![Models](docs/images/38d55905-2b45-42fa-9aef-70f75f8b019f.png)
### API Server - 路由与日志
![API Server](docs/images/54223543-bfb1-4a96-a9d8-a1b9b2f9c154.png)
### 设置页面 - 服务器配置
![Settings](docs/images/98e9b6a0-3c48-430e-9c88-220f11e9b94d.png)
![Settings](docs/images/83270842-209e-4a36-98e3-607642273806.png)
### 日志查看 - 实时操作记录
![Logs](docs/images/a60f1f5d-7196-4967-a334-274013dcd47c.png)
### AI Clients - 客户端配置
![AI Clients](docs/images/c9d36815-a29a-437e-9f26-872ed0949921.png)
### MCP 服务器管理
![MCP](docs/images/fc54f689-b092-4180-a531-a41e310c42cb.png)
### Prompts 管理
![Prompts](docs/images/ff6d0f51-a703-4642-a4ab-2b9512b332af.png)
---
Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

+45 -9
View File
@@ -1,10 +1,11 @@
import { useState } from "react";
import { useState, useEffect } from "react";
import {
ExternalLink,
RefreshCw,
CheckCircle2,
AlertCircle,
} from "lucide-react";
import { invoke } from "@tauri-apps/api/core";
interface VersionInfo {
current: string;
@@ -12,13 +13,36 @@ interface VersionInfo {
hasUpdate: boolean;
}
interface ToolVersion {
name: string;
version: string | null;
installed: boolean;
}
export function AboutSection() {
const [versionInfo] = useState<VersionInfo>({
current: "0.4.3",
current: "0.7.0",
latest: undefined,
hasUpdate: false,
});
const [checking, setChecking] = useState(false);
const [toolVersions, setToolVersions] = useState<ToolVersion[]>([]);
const [loadingTools, setLoadingTools] = useState(true);
// 加载本地工具版本
useEffect(() => {
const loadToolVersions = async () => {
try {
const versions = await invoke<ToolVersion[]>("get_tool_versions");
setToolVersions(versions);
} catch (error) {
console.error("Failed to load tool versions:", error);
} finally {
setLoadingTools(false);
}
};
loadToolVersions();
}, []);
const handleCheckUpdate = async () => {
setChecking(true);
@@ -69,7 +93,7 @@ export function AboutSection() {
<h3 className="text-sm font-medium">相关链接</h3>
<div className="space-y-2">
<a
href="https://github.com/anthropics/claude-code"
href="https://github.com/aiclientproxy/proxycast"
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-between p-3 rounded-lg border hover:bg-muted/50"
@@ -78,7 +102,7 @@ export function AboutSection() {
<ExternalLink className="h-4 w-4 text-muted-foreground" />
</a>
<a
href="#"
href="https://github.com/aiclientproxy/proxycast/wiki"
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-between p-3 rounded-lg border hover:bg-muted/50"
@@ -87,7 +111,7 @@ export function AboutSection() {
<ExternalLink className="h-4 w-4 text-muted-foreground" />
</a>
<a
href="#"
href="https://github.com/aiclientproxy/proxycast/issues"
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-between p-3 rounded-lg border hover:bg-muted/50"
@@ -102,16 +126,28 @@ export function AboutSection() {
<div className="space-y-3">
<h3 className="text-sm font-medium">本地工具版本</h3>
<div className="p-4 rounded-lg border space-y-3">
<ToolVersionItem name="Claude Code" version="检测中..." />
<ToolVersionItem name="Codex CLI" version="检测中..." />
<ToolVersionItem name="Gemini CLI" version="检测中..." />
{loadingTools ? (
<>
<ToolVersionItem name="Claude Code" version="检测中..." />
<ToolVersionItem name="Codex" version="检测中..." />
<ToolVersionItem name="Gemini CLI" version="检测中..." />
</>
) : (
toolVersions.map((tool) => (
<ToolVersionItem
key={tool.name}
name={tool.name}
version={tool.installed ? tool.version || "已安装" : "未安装"}
/>
))
)}
</div>
</div>
{/* 版权信息 */}
<div className="text-center text-xs text-muted-foreground pt-4 border-t">
<p>Made with love for AI developers</p>
<p className="mt-1">2024-2025 ProxyCast</p>
<p className="mt-1">2025-2026 ProxyCast</p>
</div>
</div>
);