sync: 同步 monkey-ai@weiyuan(ddc5b9443) 的 web/ 到 ui-optimization
- 合入 weiyuan 新功能前端:分佣 V2 / 伙伴工作台、智能路由、企业资金与分析、官网设置与预约演示等, semi-ui 已全部迁移到 antd 6 / @/components/ui,不重新引入 Semi - 分佣二级菜单与页头去重、伙伴入口探测(企业伙伴走企业中心「企业分佣」)、超管侧栏入口恢复 - 适配层 DatePicker / TimePicker 统一 onChange(Date|Date[]|null, 文本) 契约;生产构建剔除调试日志 - 图片链接刷新:同任务请求复用、后台刷新不弹全局错误、离页停止批量请求 - 恢复 bun.lock(与 package-lock.json 共存);docs 规范与 CHANGELOG 更新 - 停止跟踪 .env.playwright.local(本地登录凭据,已加入 .gitignore)
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
Copyright (C) 2025 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
// 判定来源 / 闸门 / 过滤原因的展示文案(与后端 decide.go、gate.go、filter.go 的代码一一对应)
|
||||
export const reasonText = (t, code) =>
|
||||
({
|
||||
disabled: t('已停用'),
|
||||
level: t('等级不可用'),
|
||||
scope: t('不在企业作用域白名单'),
|
||||
experience_center: t('不在体验中心白名单'),
|
||||
no_channel: t('分组内没有可用渠道'),
|
||||
channel_query_failed: t('渠道查询失败'),
|
||||
protocol: t('渠道不支持该入口格式'),
|
||||
vision: t('不支持图片输入'),
|
||||
tools: t('不支持工具调用'),
|
||||
json_mode: t('不支持 JSON 输出'),
|
||||
context: t('超出上下文长度'),
|
||||
tool_id_format: t('工具调用 ID 格式不兼容'),
|
||||
strip_incompatible: t('不兼容历史剥离'),
|
||||
reasoning: t('不支持推理 / 思考'),
|
||||
})[code] || code;
|
||||
|
||||
// Jev 调用失败原因(jev.FailureReason);http_xxx 为上游状态码
|
||||
export const jevReasonText = (t, code) => {
|
||||
if (!code) return '';
|
||||
if (/^http_\d+$/.test(code))
|
||||
return t('上游返回 {{code}}', { code: code.slice(5) });
|
||||
return (
|
||||
{
|
||||
timeout: t('判定超时'),
|
||||
breaker: t('通道熔断中'),
|
||||
no_key: t('未配置密钥'),
|
||||
parse: t('返回格式异常'),
|
||||
error: t('调用失败'),
|
||||
}[code] || code
|
||||
);
|
||||
};
|
||||
|
||||
export const gateText = (t, code) =>
|
||||
({
|
||||
jev: t('已调用 Jev'),
|
||||
platform_off: t('平台未开启 Jev 出境'),
|
||||
sensitive: t('命中敏感词'),
|
||||
desens_off: t('脱敏未启用'),
|
||||
desens_block: t('脱敏策略会拦截'),
|
||||
guard_input: t('内容审核输入审查生效'),
|
||||
org_no_consent: t('企业未授权'),
|
||||
user_no_consent: t('个人未授权'),
|
||||
profile_off: t('集合未允许使用 Jev'),
|
||||
no_quota: t('余额不足,未调用 Jev'),
|
||||
jev_cap: t('今日 Jev 判定次数已达上限'),
|
||||
desens_residual: t('脱敏后仍有敏感信息'),
|
||||
'n/a': t('未经过闸门'),
|
||||
})[code] ||
|
||||
(code && code.startsWith('rules:') ? gateText(t, code.slice(6)) : code) ||
|
||||
'-';
|
||||
|
||||
export const srcText = (t, code) =>
|
||||
({
|
||||
jev: t('Jev 判定'),
|
||||
cache: t('判定缓存'),
|
||||
rules: t('规则判定器'),
|
||||
rules_fallback: t('Jev 失败,规则判定'),
|
||||
rule: t('自定义规则'),
|
||||
rule_tier: t('自定义规则强制档位'),
|
||||
forced: t('请求指定档位'),
|
||||
single: t('唯一候选'),
|
||||
sticky: t('会话粘性'),
|
||||
continuation: t('工具调用续写'),
|
||||
default: t('默认模型'),
|
||||
cheapest: t('最便宜的候选'),
|
||||
disabled: t('未启用,使用默认模型'),
|
||||
error: t('路由失败'),
|
||||
})[code] || code;
|
||||
Reference in New Issue
Block a user