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
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:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
{/* 按模型分组 */}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user