refactor: 统一项目名称从OpenFang到ZCLAW
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

重构所有代码和文档中的项目名称,将OpenFang统一更新为ZCLAW。包括:
- 配置文件中的项目名称
- 代码注释和文档引用
- 环境变量和路径
- 类型定义和接口名称
- 测试用例和模拟数据

同时优化部分代码结构,移除未使用的模块,并更新相关依赖项。
This commit is contained in:
iven
2026-03-27 07:36:03 +08:00
parent 4b08804aa9
commit 0d4fa96b82
226 changed files with 7288 additions and 5788 deletions

View File

@@ -34,10 +34,10 @@ export function About() {
</div>
<div className="mt-12 text-center text-xs text-gray-400">
2026 ZCLAW | Powered by OpenFang
2026 ZCLAW
</div>
<div className="text-center text-xs text-gray-400 space-y-1">
<p> OpenFang Rust Agent OS </p>
<p> Rust Agent OS </p>
<div className="flex justify-center gap-4 mt-3">
<a href="#" className="text-orange-500 hover:text-orange-600"></a>
<a href="#" className="text-orange-500 hover:text-orange-600"></a>

View File

@@ -382,7 +382,7 @@ export function IMChannels() {
<div className="text-xs text-blue-700 dark:text-blue-300">
<p className="font-medium mb-1"></p>
<p> Gateway </p>
<p className="mt-1">: <code className="bg-blue-100 dark:bg-blue-800 px-1 rounded">~/.openfang/openfang.toml</code></p>
<p className="mt-1">: <code className="bg-blue-100 dark:bg-blue-800 px-1 rounded">~/.zclaw/zclaw.toml</code></p>
</div>
</div>
</div>

View File

@@ -266,13 +266,30 @@ export function ModelsAPI() {
};
// 保存 Embedding 配置
const handleSaveEmbeddingConfig = () => {
const handleSaveEmbeddingConfig = async () => {
const configToSave = {
...embeddingConfig,
enabled: embeddingConfig.provider !== 'local' && embeddingConfig.apiKey.trim() !== '',
};
setEmbeddingConfig(configToSave);
saveEmbeddingConfig(configToSave);
// Push config to Rust backend for semantic memory search
if (configToSave.enabled) {
try {
await invoke('viking_configure_embedding', {
provider: configToSave.provider,
apiKey: configToSave.apiKey,
model: configToSave.model || undefined,
endpoint: configToSave.endpoint || undefined,
});
setEmbeddingTestResult({ success: true, message: 'Embedding 配置已应用到语义记忆搜索' });
} catch (error) {
setEmbeddingTestResult({ success: false, message: `配置保存成功但应用失败: ${error}` });
}
} else {
setEmbeddingTestResult(null);
}
};
// 测试 Embedding API

View File

@@ -24,7 +24,7 @@ export function Privacy() {
<h3 className="font-medium mb-2 text-gray-900"></h3>
<div className="text-xs text-gray-500 mb-3"> Agent </div>
<div className="p-3 bg-gray-50 border border-gray-200 rounded-lg text-xs text-gray-600 font-mono">
{workspaceInfo?.resolvedPath || workspaceInfo?.path || quickConfig.workspaceDir || '~/.openfang/zclaw-workspace'}
{workspaceInfo?.resolvedPath || workspaceInfo?.path || quickConfig.workspaceDir || '~/.zclaw/zclaw-workspace'}
</div>
</div>

View File

@@ -1,19 +1,15 @@
import { useEffect, useState } from 'react';
import { useAgentStore } from '../../store/agentStore';
import { useConnectionStore } from '../../store/connectionStore';
import { BarChart3, TrendingUp, Clock, Zap } from 'lucide-react';
export function UsageStats() {
const usageStats = useAgentStore((s) => s.usageStats);
const loadUsageStats = useAgentStore((s) => s.loadUsageStats);
const connectionState = useConnectionStore((s) => s.connectionState);
const [timeRange, setTimeRange] = useState<'7d' | '30d' | 'all'>('7d');
useEffect(() => {
if (connectionState === 'connected') {
loadUsageStats();
}
}, [connectionState]);
loadUsageStats();
}, [loadUsageStats]);
const stats = usageStats || { totalSessions: 0, totalMessages: 0, totalTokens: 0, byModel: {} };
const models = Object.entries(stats.byModel || {});
@@ -56,7 +52,7 @@ export function UsageStats() {
</button>
</div>
</div>
<div className="text-xs text-gray-500 mb-4"> Token </div>
<div className="text-xs text-gray-500 mb-4">使</div>
{/* 主要统计卡片 */}
<div className="grid grid-cols-4 gap-4 mb-8">
@@ -89,6 +85,9 @@ export function UsageStats() {
{/* 总 Token 使用量概览 */}
<div className="bg-white rounded-xl border border-gray-200 p-5 shadow-sm mb-6">
<h3 className="text-sm font-semibold mb-4 text-gray-900">Token 使</h3>
{stats.totalTokens === 0 ? (
<p className="text-xs text-gray-400">Token </p>
) : (
<div className="flex items-center gap-4">
<div className="flex-1">
<div className="flex justify-between text-xs text-gray-500 mb-1">
@@ -111,6 +110,7 @@ export function UsageStats() {
<div className="text-xs text-gray-500"></div>
</div>
</div>
)}
</div>
{/* 按模型分组 */}

View File

@@ -7,18 +7,18 @@ export function Workspace() {
const workspaceInfo = useConfigStore((s) => s.workspaceInfo);
const loadWorkspaceInfo = useConfigStore((s) => s.loadWorkspaceInfo);
const saveQuickConfig = useConfigStore((s) => s.saveQuickConfig);
const [projectDir, setProjectDir] = useState('~/.openfang/zclaw-workspace');
const [projectDir, setProjectDir] = useState('~/.zclaw/zclaw-workspace');
useEffect(() => {
loadWorkspaceInfo().catch(silentErrorHandler('Workspace'));
}, []);
useEffect(() => {
setProjectDir(quickConfig.workspaceDir || workspaceInfo?.path || '~/.openfang/zclaw-workspace');
setProjectDir(quickConfig.workspaceDir || workspaceInfo?.path || '~/.zclaw/zclaw-workspace');
}, [quickConfig.workspaceDir, workspaceInfo?.path]);
const handleWorkspaceBlur = async () => {
const nextValue = projectDir.trim() || '~/.openfang/zclaw-workspace';
const nextValue = projectDir.trim() || '~/.zclaw/zclaw-workspace';
setProjectDir(nextValue);
await saveQuickConfig({ workspaceDir: nextValue });
await loadWorkspaceInfo();