sync: 同步总仓库 luoguang/monkey-ai weiyuan@bfdfb339 的 web/ 改动

同步基准:总仓库 a2ca13cb(= 本仓库初始导入 d8f3aee2)
范围:a2ca13cb..bfdfb339 中触及 web/ 的提交(不含 web/.claude/settings.local.json)

- 8490ac02 feat(aliyun): integrate Wan 3 and Qwen Image models
- 2aff08ec perf(analytics): 运营看板概览改读汇总表,首屏从 19s 降到 0.4s
- dc69335e feat(experience): 体验中心图像/视频创作升级(能力 schema、估价、新创作台)
- b059c657 fix(org): 下线 /org/create 自助加入企业页与 POST /api/org/join
- 4fcf47e6 fix(i18n): 修复中/英/韩/繁体多语言错乱,补齐日/越/泰译文
- e4c301d5 fix: merge enterprise task record date filters
- c9369b95 feat: expose enterprise image and video task records
- a410fee5 feat(claude): 无断点请求自动注入 cache_control 断点(方案 2)
- 521b3376 feat(claude): 缓存命中率优化——上游粘性路由 + 缓存时长强制改写
- 73b615dd feat(pricing): 企业成员不论登录身份均按所属企业等级计价与扣费
- f73f55c3 feat(client): 新增 WeyAi 版本说明管理与公开读取接口
- 8cdf1994 fix(topup): reset amount when switching from PayPal
- 93a4ac34 feat(baidu): configure Seedance liveness header by channel
- cb1818c5 fix(weyai): 按评审修正内容清理竞态、默认适用端与中文退回(M21)
- 04214d83 feat(weyai): WeyAi 内容管理与客户端内容接口(M21 第二部分)
- e3c4a57c feat(weyai): 设置页新增 WeyAi 页签与内容专用 COS 桶(M21 第一部分)
- b5ee8e70 fix(auth): 会话角色/状态以 DB 为准,修复提升管理员后管理接口报权限不足
- e4618fc2 fix: 修复企业看板日志聚合死循环导致 CPU 打满,并降低看板查询开销
- 584aad52 style(web): 个人中心侧边栏按 prettier 换行
- b8d87064 fix: 小程序教程隐藏充值后保留原步骤编号,企业充值判断直接用 isMiniProgramWebView
- eee7f5b2 fix: 小程序里企业首页不落到充值页,隐藏钱包入口与教程充值步骤
- 8b254d49 fix: 小程序里隐藏企业充值入口与页面
- a67661b4 fix(web): 小程序里个人中心默认页跳过充值和发票,避免来回跳转
- cff6c543 feat(web): WeyAi 小程序里打开个人中心时不出现充值和开票
- c6c99eb6 feat(billing): Claude 全部缓存写入统一按 1h 倍率计费
- 0699d1bf fix(web): 小程序 web-view 里注册页同样只显示站内方式
- 04853331 feat(web): WeyAi 小程序 web-view 里登录页只显示站内登录方式
This commit is contained in:
qiubaishen
2026-11-10 11:05:34 +08:00
parent d8f3aee261
commit 6160a23117
275 changed files with 38656 additions and 7694 deletions
+15 -2
View File
@@ -17,7 +17,20 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
export const CHANNEL_OPTIONS = [
import i18next from 'i18next';
// label 以简体中文(或厂商英文名)为 i18n 键;读取 label 时按当前界面语言翻译,
// 因此各渲染处直接使用 option.label 即可随语言切换。
const withLocalizedLabels = (options) =>
options.map((opt) => {
const labelKey = opt.label;
return Object.defineProperty({ ...opt }, 'label', {
get: () => i18next.t(labelKey),
enumerable: true,
});
});
export const CHANNEL_OPTIONS = withLocalizedLabels([
{ value: 1, color: 'green', label: 'OpenAI' },
{
value: 2,
@@ -224,6 +237,6 @@ export const CHANNEL_OPTIONS = [
color: 'green',
label: '百度 Seedance 视频',
},
];
]);
export const MODEL_TABLE_PAGE_SIZE = 10;
+195
View File
@@ -0,0 +1,195 @@
/*
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
*/
// 创作台静态灵感模板(方案 §4.4,B 阶段用静态 JSON,后台配置后置)。
// title / group 为 i18n key;prompt 是直接提交给模型的内容,不翻译。
// model(可选)为推荐模型名:可用时点击模板会切过去,否则保持当前模型(见 creationDock.templateModelFor)。
// params 为推荐参数:只套用当前模型支持且合法的值(见 hooks/creation/creationDock.templateParamsFor),
// 图像的 aspect_ratio 会映射到宽高比最接近的尺寸预设。
export const CREATION_TEMPLATES = [
// ---------------- 图像 ----------------
{
id: 'img-portrait',
kind: 'image',
group: '人像',
title: '电影感人像',
prompt:
'电影感人像特写,黄昏逆光,柔和的轮廓光勾勒发丝,浅景深背景虚化,35mm 胶片质感,细腻皮肤纹理,温暖色调',
params: { aspect_ratio: '2:3' },
},
{
id: 'img-product',
kind: 'image',
group: '商业设计',
title: '产品主图',
prompt:
'高端护肤品瓶身置于大理石台面,柔和棚拍光,水珠点缀,干净浅色背景,商业产品摄影,高清细节,留白构图',
params: { aspect_ratio: '1:1' },
},
{
id: 'img-landscape',
kind: 'image',
group: '风景空间',
title: '壮丽风光',
prompt:
'雪山日出,金色阳光洒在山峰上,山脚湖面倒影清晰,薄雾缭绕,超广角镜头,国家地理风格,细节丰富',
params: { aspect_ratio: '16:9' },
},
{
id: 'img-anime',
kind: 'image',
group: '风格化',
title: '日系动漫',
prompt:
'日系动漫风格,少女站在开满樱花的校园小路上,微风吹起发梢,明亮通透的色彩,细腻线条,新海诚式天空',
params: { aspect_ratio: '9:16' },
},
{
id: 'img-poster',
kind: 'image',
group: '商业设计',
title: '海报设计',
prompt:
'极简风格活动海报,大面积留白,几何色块构成视觉中心,现代无衬线排版区域,高级感配色,平面设计',
params: { aspect_ratio: '3:4' },
},
{
id: 'img-interior',
kind: 'image',
group: '风景空间',
title: '室内设计',
prompt:
'北欧风格客厅,大落地窗引入自然光,原木家具与米白色布艺沙发,绿植点缀,温馨通透,建筑摄影视角',
params: { aspect_ratio: '4:3' },
},
{
id: 'img-food',
kind: 'image',
group: '商业设计',
title: '美食摄影',
prompt:
'热气腾腾的拉面俯拍,溏心蛋与叉烧摆放精致,木质桌面,侧逆光突出蒸汽,美食杂志风格,色彩饱满',
params: { aspect_ratio: '1:1' },
},
{
id: 'img-3d',
kind: 'image',
group: '风格化',
title: '3D 卡通角色',
prompt:
'可爱的 3D 卡通小狐狸角色,圆润造型,柔和材质,皮克斯动画风格,纯色背景,柔光渲染,细节精致',
params: { aspect_ratio: '1:1' },
},
// ---------------- 视频 ----------------
{
id: 'vid-city',
kind: 'video',
group: '风光',
title: '城市延时',
prompt:
'城市夜景延时摄影,车流形成光轨,高楼灯光逐渐亮起,镜头缓慢向前推进,电影级画质',
params: { aspect_ratio: '16:9', duration: 5 },
},
{
id: 'vid-ocean',
kind: 'video',
group: '风光',
title: '海浪航拍',
prompt:
'无人机航拍蔚蓝海面,海浪拍打礁石溅起白色浪花,镜头缓慢上升并向前平移,阳光在水面闪烁',
params: { aspect_ratio: '16:9', duration: 5 },
},
{
id: 'vid-product',
kind: 'video',
group: '商业广告',
title: '产品旋转展示',
prompt:
'一款精致腕表在黑色背景中缓慢旋转 360 度,聚光灯打亮金属表壳,反光细腻流动,商业广告质感',
params: { aspect_ratio: '1:1', duration: 5 },
},
{
id: 'vid-portrait',
kind: 'video',
group: '人物与动物',
title: '人物情绪特写',
prompt:
'女孩站在窗边,微风吹动窗帘与发丝,她缓缓转头看向镜头并露出微笑,柔和自然光,浅景深',
params: { aspect_ratio: '9:16', duration: 5 },
},
{
id: 'vid-nature',
kind: 'video',
group: '风光',
title: '森林晨雾',
prompt:
'清晨的森林,阳光穿过树叶形成丁达尔光束,薄雾缓缓流动,镜头低角度缓慢推进,鸟儿飞过',
params: { aspect_ratio: '16:9', duration: 5 },
},
{
id: 'vid-food',
kind: 'video',
group: '商业广告',
title: '美食慢动作',
prompt:
'慢动作镜头:巧克力酱浇在层层叠叠的松饼上缓缓流下,草莓落下溅起糖粉,暖色调特写',
params: { aspect_ratio: '9:16', duration: 5 },
},
{
id: 'vid-scifi',
kind: 'video',
group: '创意',
title: '科幻场景',
prompt:
'赛博朋克风格的未来都市,霓虹灯招牌闪烁,飞行汽车穿梭于高楼之间,雨夜反光路面,镜头穿越街道',
params: { aspect_ratio: '16:9', duration: 5 },
},
{
id: 'vid-animal',
kind: 'video',
group: '人物与动物',
title: '萌宠瞬间',
prompt:
'一只橘猫在阳光洒落的木地板上伸懒腰,然后好奇地拍打飘落的羽毛,温馨自然的家庭氛围',
params: { aspect_ratio: '9:16', duration: 5 },
},
];
/** 某 kind 的模板列表。 */
export const templatesOf = (kind) =>
CREATION_TEMPLATES.filter((tpl) => tpl.kind === kind);
/** 某 kind 的模板按 group 分组(保持出现顺序):[{ group, items }]。模板墙使用。 */
export const templateGroupsOf = (kind) => {
const groups = [];
templatesOf(kind).forEach((tpl) => {
const name = tpl.group || '';
let entry = groups.find((g) => g.group === name);
if (!entry) {
entry = { group: name, items: [] };
groups.push(entry);
}
entry.items.push(tpl);
});
return groups;
};
export default CREATION_TEMPLATES;
+6 -1
View File
@@ -17,6 +17,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import i18next from 'i18next';
// 图像生成模型族能力注册表
// 新增模型族(如阿里云万相)只需在 FAMILIES 中追加一条
// 表单和 hook 都从这里读,确保单一事实源
@@ -91,7 +93,10 @@ const FAMILIES = [
},
{
key: 'wanx',
label: '阿里云万相',
// 展示名随界面语言翻译(读取时求值)
get label() {
return i18next.t('阿里云万相');
},
// wanx-* / qwen-image / qwen-image-*
match: (m) => /^(wanx|qwen-image)/i.test(m),
sizes: [
+22 -2
View File
@@ -17,6 +17,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import i18next from 'i18next';
/**
* 模型分类常量
* 用于在体验中心按照用途对模型进行分类
@@ -59,8 +61,22 @@ export const MODEL_CATEGORY = {
OTHER: 'other',
};
// 模型分类显示名称(多语言支持)
export const MODEL_CATEGORY_NAMES = {
// 模型分类显示名称(多语言支持):值以简体中文为 i18n 键,读取时按当前界面语言翻译,
// 因此 MODEL_CATEGORY_NAMES[key] / Object.entries() 拿到的都是当前语言的展示名。
const withLocalizedValues = (map) =>
Object.defineProperties(
{},
Object.fromEntries(
Object.entries(map).map(([key, zhName]) => [
key,
{ get: () => i18next.t(zhName), enumerable: true },
]),
),
);
// 简体中文原文(即 i18n 键)。需要拷贝/合并映射时用这份,展开 MODEL_CATEGORY_NAMES
// 会把 getter 求值成当时语言的译文,切换语言后不再刷新。
export const MODEL_CATEGORY_NAME_KEYS = {
[MODEL_CATEGORY.TEXT_GENERATION]: '文本生成',
[MODEL_CATEGORY.IMAGE_GENERATION]: '图像生成',
[MODEL_CATEGORY.TEXT_TO_IMAGE]: '文生图',
@@ -77,6 +93,10 @@ export const MODEL_CATEGORY_NAMES = {
[MODEL_CATEGORY.OTHER]: '其他',
};
export const MODEL_CATEGORY_NAMES = withLocalizedValues(
MODEL_CATEGORY_NAME_KEYS,
);
// 根据模型名称或端点类型推断模型分类
export const inferModelCategory = (modelName = '', endpointType = '') => {
const lowerModelName = modelName.toLowerCase();
+2
View File
@@ -24,6 +24,8 @@ For commercial licensing, please contact support@quantumnous.com
*/
export const SETTING_TABS = [
{ key: 'operation', labelKey: '运营设置' },
// WeyAi 的所有配置项都放在这个页签下(M21,WeyAi 23 号文档第 3.3 节)
{ key: 'weyai', labelKey: 'WeyAi' },
{ key: 'data-security', labelKey: '数据安全' },
{ key: 'content-guard', labelKey: '大模型内容防护' },
{ key: 'dashboard', labelKey: '仪表盘设置' },
+9 -7
View File
@@ -17,11 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import i18next from 'i18next';
// 技能分类标签的展示名映射(技能超市 + 平台管理台共用)。
//
// 标签在数据层是版本 frontmatter 里的英文 slug(skill_versions.tags_json),
// 是过滤与统计的稳定键,绝不能翻译后写回数据库——这里只做**展示层**映射:
// 中文界面显示中文名,未收录的 slug(含本就是中文的标签)原样展示,
// 展示名以中文为 i18n 键按界面语言翻译,未收录的 slug(含本就是中文的标签)原样展示,
// 过滤请求仍然携带原始 slug。
//
// 新导入技能包引入新 slug 时在此补充即可;漏补不会出错,只是该分类
@@ -127,12 +129,12 @@ const SKILL_CATEGORY_ZH = {
'personal-development': '个人成长',
};
// 返回标签在指定语言下的展示名。
// language 取值 {zh, en}(与 NormalizeBrainLocale 同语义);en 界面直接
// 展示原始 slug——slug 本身就是英文,强行再造一套英文标题反而增加维护面。
export const skillTagLabel = (tag, language = 'zh') => {
if (language !== 'zh') return tag;
return SKILL_CATEGORY_ZH[tag] || tag;
// 返回标签在当前界面语言下的展示名:已收录的 slug 以中文名为 i18n 键经
// i18next.t() 翻译(随界面语言切换);未收录的 slug 原样展示。
// 旧调用方传入的第二个 language 参数已不再参与判断,可忽略。
export const skillTagLabel = (tag) => {
const zhName = SKILL_CATEGORY_ZH[tag];
return zhName ? i18next.t(zhName) : tag;
};
export default SKILL_CATEGORY_ZH;