Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
🚀 快速开始
## 🚀 快速开始

```
npm install # 安装依赖
npm run dev # 启动项目
npm run mock # 启动后台Mock服务(可选)
```

📁 项目结构
## 📁 项目结构

```
frontend/
Expand Down Expand Up @@ -94,3 +94,10 @@ frontend/
├── vite.config.ts # 开源协议
└── pom.xml # Maven根配置
```

## 开发新功能
- 安装开发依赖:

```bash
npm install xxx
```
86 changes: 82 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
"@reduxjs/toolkit": "^2.11.2",
"@xyflow/react": "^12.8.3",
"antd": "^5.27.0",
"i18next": "^25.8.0",
"jssha": "^3.3.1",
"lucide-react": "^0.539.0",
"react": "^18.1.1",
"react-dom": "^18.1.1",
"react-force-graph-2d": "^1.29.0",
"react-force-graph-3d": "^1.29.0",
"react-i18next": "^16.5.4",
"react-markdown": "^10.1.0",
"react-redux": "^9.2.0",
"react-router": "^7.8.0",
Expand Down
20 changes: 20 additions & 0 deletions frontend/public/config/error-code.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"400": "请求参数错误",
"401": "登录已过期,请重新登录",
"403": "没有权限访问该资源",
"404": "请求的资源不存在",
"500": "服务器内部错误,请稍后重试",
"502": "网关错误",
"op.0001": "不支持的文件类型",
"op.0002": "算子中缺少元数据文件",
"op.0003": "缺少必要的字段",
"op.0004": "settings字段解析失败",
"op.0005": "算子ID已存在",
"op.0006": "算子名称已存在",
"op.0007": "算子已被编排在模板或未完成的任务中",
"op.0008": "预置算子无法删除",
"clean.0001": "清洗任务名称重复",
"clean.0002": "任务列表为空",
"clean.0003": "算子输入输出不匹配",
"clean.0004": "算子执行器不匹配"
}
29 changes: 29 additions & 0 deletions frontend/src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import zhCommon from './locales/zh/common.json';
import enCommon from './locales/en/common.json';

// Get saved language from localStorage, default to 'zh'
const savedLanguage = localStorage.getItem('language') || 'zh';

i18n
.use(initReactI18next)
.init({
resources: {
zh: {
common: zhCommon,
},
en: {
common: enCommon,
},
},
lng: savedLanguage,
fallbackLng: 'zh',
ns: ['common'],
defaultNS: 'common',
interpolation: {
escapeValue: false,
},
});

export default i18n;
Loading
Loading