feat(router): 统一智能路由判定模型文案与多语言显示

同步全栈仓库 2e6865aa3 的 web/ 更新。
This commit is contained in:
qiubaishen
2026-11-26 16:25:40 +08:00
parent 9576ba674a
commit a811793825
17 changed files with 287 additions and 236 deletions
+11 -9
View File
@@ -51,7 +51,7 @@ const FIELDS = [
{
key: 'jev_egress_allowed',
type: 'bool',
label: '允许调用 Jev(数据出境,合规评估通过后开启)',
label: '允许调用境外判定模型(通过合规评估后开启)',
section: 'jev',
compliance: true,
},
@@ -99,7 +99,7 @@ const FIELDS = [
{
key: 'state_max_bytes',
type: 'int',
label: '发给 Jev 的内容上限(字节)',
label: '发送给判定模型的内容上限(字节)',
min: 1000,
max: 30000,
section: 'jev',
@@ -185,7 +185,7 @@ const FIELDS = [
{
key: 'jev_daily_cap_per_user',
type: 'int',
label: 'Jev 判定每人每日上限(0 不限)',
label: '每人每日模型判定次数上限(0 表示不限)',
min: 0,
max: 10000000,
section: 'retention',
@@ -193,7 +193,7 @@ const FIELDS = [
{
key: 'jev_daily_cap_per_org',
type: 'int',
label: 'Jev 判定每企业每日上限(0 不限)',
label: '每个企业每日模型判定次数上限(0 表示不限)',
min: 0,
max: 100000000,
section: 'retention',
@@ -202,7 +202,7 @@ const FIELDS = [
const SECTIONS = [
['main', '总控'],
['jev', 'Jev 判定'],
['jev', '判定模型'],
['judge', '判定参数'],
['consent', '同意文案'],
['retention', '保留与限流'],
@@ -267,7 +267,7 @@ const GlobalSettings = () => {
await saveOption(PREFIX + f.key, String(values[f.key] ?? ''));
saved[f.key] = values[f.key];
} catch (e) {
showError(`${t(f.label)} · ${e?.message || ''}`);
showError(`${t(f.label)} · ${e?.message ? t(e.message) : ''}`);
// 已保存的项更新基线,未保存的编辑保留在表单里,便于修改后重试
setOriginal((o) => ({ ...o, ...saved }));
return;
@@ -294,7 +294,9 @@ const GlobalSettings = () => {
if (!clear) return run();
Modal.confirm({
title: t('确认清除密钥?'),
content: t('清除后该通道无法调用 Jev,判定会降级为规则判定。'),
content: t(
'清除后,此通道将无法调用判定模型。所有通道均不可用时,将使用规则判定。',
),
okButtonProps: { danger: true },
onOk: run,
});
@@ -426,7 +428,7 @@ const GlobalSettings = () => {
</span>
</Tag>
<Tag>
{t('Jev 降级次数')}{' '}
{t('模型判定失败后使用规则的次数')}{' '}
<span className='smart-router-num'>{status.jev_fallback}</span>
</Tag>
<Tag color={status.not_ready ? 'warning' : 'default'}>
@@ -445,7 +447,7 @@ const GlobalSettings = () => {
type='warning'
showIcon
title={t(
'标注「合规」的配置项只有超级管理员可以修改。开启 Jev 出境前须完成合规评估。',
'标注「合规」的配置项仅限超级管理员修改。启用境外判定模型前须完成合规评估。',
)}
/>
{SECTIONS.map(([sec, title]) => (