Skip to content

Commit 31e2305

Browse files
committed
Merge branch 'main' of https://github.com/SECTL/SecScore
2 parents 07d96ff + f30923c commit 31e2305

24 files changed

+2927
-431
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ db.sqlite
1818
!.vscode/extensions.json
1919
!.vscode/launch.json
2020
!.vscode/settings.json
21-
/.trae/

.trae/rules/coding-rules.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
该项目使用pnpm作为包管理器
2+
每次写完代码后请务必跑一遍格式化和lint,typecheck,一个warning都不可以有
3+
每次完成任务请详细告知用户“你干了什么”和要确认的问题(如有)。

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
"chokidar": "^5.0.0",
4141
"es-object-atoms": "^1.1.1",
4242
"express": "^5.2.1",
43-
"json-rules-engine": "^7.3.1",
43+
"i18next": "^25.8.14",
4444
"mica-electron": "^1.5.16",
4545
"os": "^0.1.2",
4646
"pg": "^8.19.0",
4747
"pinyin-pro": "^3.27.0",
48-
"react-querybuilder": "^8.14.0",
48+
"react-i18next": "^16.5.6",
4949
"react-router-dom": "^6.28.0",
5050
"reflect-metadata": "^0.2.2",
5151
"typeorm": "^0.3.27",

pnpm-lock.yaml

Lines changed: 60 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/src/App.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { Layout, Modal, Input, message, ConfigProvider, theme as antTheme } from 'antd'
22
import { useEffect, useMemo, useState } from 'react'
33
import { HashRouter, useLocation, useNavigate, Routes, Route } from 'react-router-dom'
4+
import { useTranslation } from 'react-i18next'
45
import { Sidebar } from './components/Sidebar'
56
import { ContentArea } from './components/ContentArea'
6-
import { Wizard } from './components/Wizard'
7+
import { OOBE } from './components/OOBE'
78
import { ThemeProvider, useTheme } from './contexts/ThemeContext'
89

910
function MainContent(): React.JSX.Element {
11+
const { t } = useTranslation()
1012
const navigate = useNavigate()
1113
const location = useLocation()
1214
const { currentTheme } = useTheme()
@@ -80,9 +82,9 @@ function MainContent(): React.JSX.Element {
8082
setPermission(res.data.permission)
8183
setAuthVisible(false)
8284
setAuthPassword('')
83-
messageApi.success('权限已解锁')
85+
messageApi.success(t('auth.unlocked'))
8486
} else {
85-
messageApi.error(res.message || '密码错误')
87+
messageApi.error(res.message || t('common.error'))
8688
}
8789
}
8890

@@ -91,7 +93,7 @@ function MainContent(): React.JSX.Element {
9193
const res = await (window as any).api.authLogout()
9294
if (res?.success && res.data) {
9395
setPermission(res.data.permission)
94-
messageApi.success('已切换为只读')
96+
messageApi.success(t('auth.logout'))
9597
}
9698
}
9799

@@ -129,25 +131,25 @@ function MainContent(): React.JSX.Element {
129131
onLogout={logout}
130132
/>
131133

132-
<Wizard visible={wizardVisible} onComplete={() => setWizardVisible(false)} />
134+
<OOBE visible={wizardVisible} onComplete={() => setWizardVisible(false)} />
133135

134136
<Modal
135-
title="权限解锁"
137+
title={t('auth.unlock')}
136138
open={authVisible}
137139
onCancel={() => setAuthVisible(false)}
138140
onOk={login}
139141
confirmLoading={authLoading}
140-
okText="解锁"
141-
cancelText="取消"
142+
okText={t('auth.unlockButton')}
143+
cancelText={t('common.cancel')}
142144
>
143145
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
144146
<div style={{ color: 'var(--ss-text-secondary)', fontSize: '12px' }}>
145-
输入 6 位数字密码:管理密码=全功能,积分密码=仅积分操作。
147+
{t('auth.unlockHint')}
146148
</div>
147149
<Input
148150
value={authPassword}
149151
onChange={(e) => setAuthPassword(e.target.value)}
150-
placeholder="例如 123456"
152+
placeholder={t('auth.passwordPlaceholder')}
151153
maxLength={6}
152154
/>
153155
</div>

0 commit comments

Comments
 (0)