Compare commits

...

6 Commits

Author SHA1 Message Date
zhanjunhao 86e6fcf30a chore(merge): 将 ui-optimization 合并到 weiyuan 2026-11-20 15:18:15 +08:00
zhanjunhao b3f4711d20 perf(build): 优化开发预热与首屏分包懒加载
减少应用启动时的静态依赖,增加首屏体积预算与懒加载边界校验。验证通过:875 项单测、UI 依赖审计、ESLint、Prettier、生产构建与首屏产物校验;Chrome 模拟回归通过。
2026-11-20 15:03:30 +08:00
zhanjunhao 03276c5207 refactor(ui-deps): 统一组件依赖审计与回归规则 2026-11-20 14:11:11 +08:00
zhanjunhao ccde35d22e fix(pagination): 统一表格分页与密钥查询交互
统一各中心表格的分页样式与切换行为,保留密钥筛选条件和兑换码搜索分页。

验证:871 项单测、ESLint、Prettier 和本地浏览器验收通过。
2026-11-20 12:52:45 +08:00
zhanjunhao b7755187e3 fix(customer-service): 修复客服浮钮展开与关闭后的箭头状态 2026-11-20 12:48:02 +08:00
zhanjunhao 8a48765a46 chore(repo): 移除重复版权文件头并纳入共享单测
集中保留原版权声明,移除文件头检查和全局测试忽略规则。验证:全量单测、受影响用例复测及静态检查通过。
2026-11-20 11:23:49 +08:00
954 changed files with 3137 additions and 18022 deletions
-4
View File
@@ -14,10 +14,6 @@ node_modules/
/e2e/
/.e2e/
/tests/
*.test.*
*.spec.*
# Maintained unit regressions are source; local acceptance suites stay ignored.
!test/unit/*.test.js
/playwright/.auth/
/playwright-report/
/test-results/
+2 -2
View File
@@ -60,7 +60,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd
- **样式**:不新增 ConfigProvider、主题状态或存储 key;颜色只来自 token 或页面变量,JSX 不写十六进制,不用全局 `!important`。
- **图标与依赖**:按钮图标从 `src/components/common/icons/ActionIcons.js` 导入,装饰图标用 `lucide-react`;禁止引入 Semi、Radix UI、Floating UI、`@lobehub/*`、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit。
- **请求**:只用 `API`,参数用 `params`,先判 `success`;分页 `p` 从 1 开始、`page_size` ≤ 100;`catch` 不重复提示 AxiosError;`finally` 回收 loading。
- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;新 `.js` / `.jsx` 带 AGPL 许可证头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。
- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;不重复添加通用长版权文件头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。
- **可访问性**:交互元素可键盘操作且焦点可见;纯图标按钮加 `aria-label`;状态不只靠颜色表达;动效遵守 `prefers-reduced-motion`。
## 5. 目录规则
@@ -123,7 +123,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd
- 新规则先写入对应 `docs/` 文档,再在第 6 节加索引;改动只动相关段落,更新本节版本与日期。
- 文档的新增、调整、删除按 `docs/README.md` 的“阅读与维护”执行;删除与重命名需用户确认清单。
> 规范版本:v3.6 · 更新:2026-11-19
> 规范版本:v3.7 · 更新:2026-11-20
## 10. 工具差异(本节允许不同)
+2 -2
View File
@@ -60,7 +60,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd
- **样式**:不新增 ConfigProvider、主题状态或存储 key;颜色只来自 token 或页面变量,JSX 不写十六进制,不用全局 `!important`。
- **图标与依赖**:按钮图标从 `src/components/common/icons/ActionIcons.js` 导入,装饰图标用 `lucide-react`;禁止引入 Semi、Radix UI、Floating UI、`@lobehub/*`、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit。
- **请求**:只用 `API`,参数用 `params`,先判 `success`;分页 `p` 从 1 开始、`page_size` ≤ 100;`catch` 不重复提示 AxiosError;`finally` 回收 loading。
- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;新 `.js` / `.jsx` 带 AGPL 许可证头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。
- **命名与文件**:状态用 `items`、`total`、`page`、`pageSize`、`loading`、`submitting`、`editingRecord`、`drawerOpen`;不重复添加通用长版权文件头;入库单测放 `test/unit/`;新文案用 `t('中文原文')` 并补齐 9 个语言包。
- **可访问性**:交互元素可键盘操作且焦点可见;纯图标按钮加 `aria-label`;状态不只靠颜色表达;动效遵守 `prefers-reduced-motion`。
## 5. 目录规则
@@ -123,7 +123,7 @@ Windows 执行命令前按开发规范第 12.3 节设置 UTF-8;使用 `npm.cmd
- 新规则先写入对应 `docs/` 文档,再在第 6 节加索引;改动只动相关段落,更新本节版本与日期。
- 文档的新增、调整、删除按 `docs/README.md` 的“阅读与维护”执行;删除与重命名需用户确认清单。
> 规范版本:v3.6 · 更新:2026-11-19
> 规范版本:v3.7 · 更新:2026-11-20
## 10. 工具差异(本节允许不同)
+18
View File
@@ -0,0 +1,18 @@
# Copyright and License Notice
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
+7 -3
View File
@@ -135,7 +135,7 @@ monkey-ai-web/
- **路由与权限**:在 `src/App.jsx` 注册路由,用 `PrivateRoute`、`AdminRoute`(role ≥ 10)、`RootRoute`(role ≥ 100)守卫;企业中心子路由在 `src/pages/Organization/index.jsx`。部分模块的可见性来自 `/api/status`,不能只靠隐藏菜单控制权限。
- **UI**:通用组件用 Ant Design;存量页面经 `src/components/ui` 适配层保留原契约;主题只由 `UiThemeProvider` 提供,不新增 ConfigProvider;按钮图标从 `src/components/common/icons/ActionIcons.js` 导入。页面改动需检查浅色、深色与窄屏。
- **国际化**:文案写 `t('中文原文')`,新 key 补齐 `src/i18n/locales/` 下 9 个语言包;运行时开放语言以 `src/i18n/catalog.js` 为准(简中、繁中、英、日、韩、越、泰),`fr.json`、`ru.json` 尚未登记。
- **文件头**:每个 `.js` / `.jsx` 顶部须带 AGPL 许可证注释(ESLint 强制),参考相邻文件。
- **版权声明**:通用版权与许可声明见 [NOTICE.md](NOTICE.md),源码无需重复添加长文件头;保留独立的第三方声明。
## 6. 常用命令与提交检查
@@ -143,11 +143,12 @@ monkey-ai-web/
| --- | --- |
| `npm run dev` | 启动开发服务 |
| `npm run build` | 生产构建,输出 `dist/` |
| `npm run verify:build -- <产物目录> --startup` | 校验静态入口、首屏 JS gzip 预算和按需加载边界;产物须用 `--manifest` 生成 |
| `npm run preview` | 本地预览构建结果(默认端口 4173) |
| `npm test -- --test-concurrency=1` | 串行运行单测(扫描 `src/`、`tests/`、`test/unit/`) |
| `npm test -- --test-concurrency=1` | 串行运行单测(扫描 `src/`、`tests/`、`test/unit/`;新增共享单测放 `test/unit/`) |
| `npm run eslint` / `npm run eslint:fix` | ESLint 检查(零警告门禁)/ 自动修复 |
| `npm run lint` / `npm run lint:fix` | Prettier 检查 / 全仓格式化 |
| `npm run check:ui` | UI 依赖、完整 lock 图与品牌图标资产 hash 审计 |
| `npm run check:ui` | 审计应用源码、脚本、单测和根目录 JS 配置中的旧 UI 库引用,以及依赖声明、锁文件和品牌图标资产 SHA-256 |
| `npm run check` | 依次执行 `check:ui`、ESLint、单测与生产构建,任一步失败即停止 |
| `npm run vendor:icons` | 重新生成品牌图标资产 |
| `npm run test:e2e` / `test:e2e:headed` / `test:e2e:report` | Playwright 验收 / 有头运行 / 查看报告 |
@@ -191,6 +192,9 @@ Trace、失败截图、CI JUnit 在 `test-results/<runId>/`,HTML 在 `playwrig
## 7. 构建与部署
- **首屏分包**:React 运行时独立缓存,公告和协议预览保留在按需 chunk;首页仅在收到非空 Markdown 时下载解析器。首屏启动 JS 预算为 820 KiB gzip,不含路由按需包和 CSS;验收构建使用 `npm run build -- --manifest --outDir <临时目录>`,再执行 `npm run verify:build -- <临时目录> --startup`。
- **开发预热**:只预热应用入口、布局和路由,不预热所有页面或禁用依赖发现。没有全量 `vendor` 分组,也没有将图表、文档等浏览器依赖外置。
```bash
npm ci
npm run build
+64 -1
View File
@@ -1,6 +1,6 @@
# 变更记录(CHANGELOG)
> 状态:有效(持续追加) · 更新:2026-11-19 · 版本:v3.6
> 状态:有效(持续追加) · 更新:2026-11-20 · 版本:v3.7
对现状仍有影响的功能与修复记录,按日期倒序。改造、迁移、优化等一次性过程不在此记录。
@@ -10,6 +10,69 @@
## 2026-11-20
### 性能 · 开发预热与公共首屏分包
- **范围**:Vite 开发和生产配置、应用启动、首页和认证页的加载边界。
- **变更**:预热入口、布局和路由;启动路径直接导入所需模块,拆出可单独缓存的 React 运行时;公告、协议预览和首页 Markdown 解析按需加载。
- **影响**:减少默认首页和认证页首屏 JS,不改变接口、权限、设置与登录流程;支持基于构建清单验收启动预算及懒加载边界。
- **回滚**:仅逆向恢复本条对应的配置、显式导入、懒加载与产物校验差异。
- **关联**:`vite.config.js`、`src/index.jsx`、`src/components/auth/LazyAgreementModal.jsx`、`scripts/verify-build.mjs`。
### 修复 · 旧 UI 库审计规则统一
- **范围**:ESLint、UI 依赖审计、回归单测与开发文档。
- **变更**:通过共享规则拦截旧 UI 包的导入、重导出及静态可确定的动态加载;审计扩展到根目录 JS 配置、脚本和单测,并检查 npm 别名与嵌套传递依赖。
- **影响**:不改变运行时依赖或 UI 行为;保留本地品牌图标的来源与 SHA-256 校验。
- **回滚**:仅逆向恢复本条对应的规则、审计、测试和文档差异。
- **关联**:`eslint.config.cjs`、`scripts/ui-dependency-policy.cjs`、`scripts/check-ui-dependencies.mjs`、`test/unit/ui-dependency-policy.test.js`。
### 修复 · 个人密钥管理查询交互对齐
- **范围**:用户中心密钥管理的查询、搜索、分页。
- **变更**:保留按名称、Key 或分组匹配的单输入框,对齐控制台的输入防抖、立即搜索和重置操作。
- **影响**:普通列表复用 `/api/token/` 服务端分页;搜索复用该个人接口取全,在本地匹配和分页,不调用管理员接口。
- **回滚**:仅逆向恢复本条对应的查询表单和密钥数据加载差异。
- **关联**:`src/pages/KeyManagement/index.jsx`、`src/hooks/tokens/useTokensData.jsx`、`docs/ui/KEY_MANAGEMENT_SPEC.md`。
### 修复 · 客服浮钮收起箭头残留
- **范围**:全站右下角客服浮钮。
- **变更**:从展开状态打开面板后,仅用底部圆形关闭按钮关闭时保留收起箭头;点面板右上角关闭或外部时隐藏箭头。点击侧边展开按钮后,箭头不再因按钮位置变化而立即消失;从收起状态临时打开面板后仍回到收起状态。
- **影响**:保留键盘焦点反馈和触屏收起入口,不改变客服会话逻辑。
- **回滚**:逆向恢复本条对应的客服浮钮焦点处理和样式差异。
- **关联**:`src/components/customer-service/index.jsx`、`src/components/customer-service/styles.css`。
### 修复 · 全站表格统一分页
- **范围**:各中心、业务页面、卡片和弹层内原有分页的表格。
- **变更**:统一为密钥管理的小型右对齐分页,补齐单页结果的条数入口和移动端跳页;未启用分页的表格保持原样。
- **影响**:前端分页继续使用已加载数据,接口分页沿用原接口与筛选条件;换条数回到第一页,已分页的行不再二次切片。密钥管理本地筛选不再仅查当前接口页;兑换码翻页和换条数保留已提交的关键词。
- **回滚**:逆向恢复本条对应的共享分页、页面分页接入、测试和规范差异。
### 更新 · 移除重复的长版权文件头
- **范围**:源码、脚本、样式、配置和测试中的统一长文件头。
- **变更**:将原声明集中到 `NOTICE.md`,移除重复模板、ESLint 文件头规则及相关依赖。
- **影响**:不改变业务逻辑,独立版权和第三方声明保持原样。
- **回滚**:按本条差异逆向恢复长文件头、规则、依赖和规范,保留其他工作区改动。
- **关联**:`NOTICE.md`、`eslint.config.cjs`、`package.json`、`package-lock.json`、`docs/standards/DEV_STANDARDS.md`。
### 修复 · ESLint 不再自动补写许可证头
- **范围**:JavaScript / JSX 许可证头检查。
- **变更**:保留原许可证校验,关闭该规则的自动写入与替换。
- **影响**:文件头缺失仍报错,现有版权和许可证声明保持不变。
- **回滚**:还原本条配置和文档差异。
- **关联**:`eslint.config.cjs`、`README.md`、`docs/standards/DEV_STANDARDS.md`。
### 修复 · 共享单测不再被全局忽略
- **范围**:Git 忽略规则和前端单测目录。
- **变更**:移除按测试扩展名全局忽略的规则,将 12 个本地回归测试迁入 `test/unit/`,保留已跟踪的存量测试。
- **影响**:团队可共享这些测试;本地验收目录仍被忽略,不改变生产代码。
- **回滚**:恢复本条忽略规则与文档差异,并将迁移用例按原路径移回。
- **关联**:`.gitignore`、`test/unit/`、`docs/standards/DEV_STANDARDS.md`、`README.md`。
### 修复 · 全量 undefined / NaN 展示防护与主题兼容回归
- **范围**:分析看板、组织/个人中心、充值/发票/订单/订阅、佣金、渠道模型测试、服务监控,以及亮色/暗色主题下的数字展示路径。
+8 -12
View File
@@ -1,6 +1,6 @@
# 统一开发与 Ant Design CRUD 规范
> 状态:有效 · 适用:React 18.3、antd 6.7.0、Vite 5.4、Node ≥ 22.13 · 更新:2026-11-18 · 版本:v2.3
> 状态:有效 · 适用:React 18.3、antd 6.7.0、Vite 5.4、Node ≥ 22.13 · 更新:2026-11-20 · 版本:v2.5
新增与重构 CRUD 的编码规范:目录与命名、组件选择、请求、React 组件与状态、表单与弹层、权限、i18n,以及可直接复制的页面模板。外观取值见 `UI_COMPONENT_STANDARDS.md`。
@@ -18,7 +18,7 @@
| React | 函数组件 + Hooks;派生值在渲染中计算;记忆化只用于测量过的问题(第 4 节) |
| 状态命名 | `items`、`total`、`page`、`pageSize`、`filters`、`loading`、`submitting`、`editingRecord`、`drawerOpen` |
| 表单 | `Form.useForm` + `rules`;失败不关闭弹层;提交按钮 `loading` 防重复(第 6 节) |
| 文件 | 带 AGPL 许可证头;单测放 `test/unit/`;文案补齐 9 个语言包 |
| 文件 | 不重复添加通用长版权文件头;单测放 `test/unit/`;文案补齐 9 个语言包 |
**相关代码**:`src/helpers/api.js`、`src/helpers/utils.jsx`、`src/helpers/paging.js`、`src/helpers/auth.jsx`、`src/components/ui/`、`src/components/console/`、`src/pages/Organization/components/`
@@ -39,7 +39,7 @@
| 视图(企业中心) | `src/pages/Organization/Org<Module>.jsx`,Hook 放 `src/hooks/org/` | 同上;单文件过大时拆到 `components/` |
| 视图(用户中心) | `src/pages/UserCenter/<Module>.jsx` + 同名 `.css` | 同上 |
| 控制台路由入口 | `src/pages/<Module>/index.jsx` | 由 `App.jsx` 以 `React.lazy` 加载 |
| 单元测试 | `test/unit/<module>-*.test.js` | `.gitignore` 忽略 `*.test.*`,仅此目录可入库 |
| 单元测试 | `test/unit/<module>-*.test.js` | `.gitignore` 不再按测试扩展名全局忽略;保留已跟踪的存量测试 |
### 1.2 命名
@@ -53,9 +53,9 @@
| 样式 | 页面根类 + 局部变量族 `--<前缀>-*`;文件 kebab-case | `.km-page`、`--km-card-border`、`key-management.css` |
| 后端字段 | 保持 snake_case 原样,不在前端改名 | `created_time`、`page_size` |
### 1.3 必备文件头
### 1.3 版权声明
ESLint 规则 `header/header` 要求每个 `.js/.jsx` 顶部带 AGPL 许可证块注释,直接复制任一现有源码文件的第 1–18 行;缺失会让 `npm run eslint` 失败。
通用版权与许可声明集中保留在 [NOTICE.md](../../NOTICE.md)。源码不重复添加长版权文件头,不移除独立的第三方声明。
## 2. Ant Design 组件边界
@@ -110,7 +110,7 @@ ESLint 规则 `header/header` 要求每个 `.js/.jsx` 顶部带 AGPL 许可证
- 外观取值(颜色、间距、圆角、字号、各组件样式)以 `docs/standards/UI_COMPONENT_STANDARDS.md` 为准,本文只写编码约束。
- 按钮与操作图标:`import { Plus, Pencil, Trash2, RefreshCw, Search } from '@/components/common/icons/ActionIcons'`,按钮内传 `size={16}`;装饰图标用 `lucide-react`。
- 禁止导入 `@lobehub/*`、Radix UI、Floating UI、Semi、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit(ESLint `no-restricted-imports` 与 `npm run check:ui` 拦截)。
- 禁止导入 `@lobehub/*`、Radix UI、Floating UI、Semi、MUI(含旧 `@material-ui/*`)、Chakra、Headless UI、leva、antd-style、react-layout-kit。ESLint 的 `ui-dependencies/no-legacy-ui` 与 `npm run check:ui` 共用 `scripts/ui-dependency-policy.cjs`,不要在入口重复维护包名。
- JSX 不写十六进制颜色;不用全局 `!important`;新视图不用 Tailwind 颜色类(如 `text-gray-500`),改用 token 或页面变量。
## 3. 请求封装与错误处理
@@ -202,7 +202,7 @@ try {
- 批量操作:`rowSelection={{ selectedRowKeys, onChange: setSelectedRowKeys }}`。
- 删除后的页码回退、筛选后的页码重置放在 hook 中处理(不要散落在组件中)。
- 列设置只用于已有该功能的表格(`docs/ui/TABLE_COLUMN_SETTINGS_SPEC.md`)。
- 分页统一用适配层 `Table` / `Pagination`;`/console`、`/org` 下自动统一,其他路由按下例显式传入,避免改页容量时请求两次:
- 所有路由的分页表格用适配层 `Table` / `Pagination`。完整数据交给 `Table` 本地分页,不传 `total`;已由页面筛选切片或由接口返回单页数据时传 `total`,表格不会再次切片。未开启分页的表格保持原样。受控分页按下例传入,条数回调自行回到第 1 页,不再触发翻页回调:
```jsx
pagination={{
@@ -211,10 +211,6 @@ pagination={{
total,
onPageChange: handlePageChange,
onPageSizeChange: handlePageSizeChange,
showSizeChanger: true,
pageSizeOpts: [10, 20, 50, 100],
showTotal: (count) => t('共 {{total}} 条', { total: count }),
preventPageChangeOnPageSizeChange: true,
}}
```
@@ -294,7 +290,7 @@ pagination={{
### 12.1 检查与构建
- Prettier:`singleQuote`、`jsxSingleQuote`,换行 LF;规范类文档使用紧凑表格(`.prettierrc.mjs` 的 overrides)。
- ESLint:许可证头、`no-undef`、未使用 import 报错、Hooks 规则、禁用 UI 库导入,`--max-warnings=0`。
- ESLint:`no-undef`、未使用 import 报错、Hooks 规则、禁用 UI 库导入,`--max-warnings=0`。
```bash
npm run eslint # 0 错误 0 警告
+4 -3
View File
@@ -1,6 +1,6 @@
# UI 公共组件与样式规范
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v2.5
> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-20 · 版本:v2.6
所有后台页面共用的主题与组件标准。页面规范只记录与本文不同的部分;编码约定见 `DEV_STANDARDS.md`,外壳与布局见 `GLOBAL_UI_BASELINE.md`。
@@ -172,6 +172,7 @@ html.dark .km-page {
- 外观:小尺寸,可切换每页条数 `[10, 20, 50, 100]`,总数文案 `t('共 {{total}} 条', { total })`。
- 用法:分页列表使用 `@/components/ui` 的 `Table` / `Pagination`。第 4 节的标准列表及其明细分页均沿用密钥管理:表格底部右对齐、小尺寸,依次显示“共 N 条”、上一页/页码/下一页、每页条数(10、20、50、100),移动端保留跳页。已加载的明细可本地分页;服务端分页传 `currentPage`、`pageSize`、`total` 以及分页回调,切换每页条数回到第 1 页,只发一次请求。导出仍作用于原有结果范围,不受当前页条数影响。
- 删除当前页最后一条后回到上一页;前端分页的列表在筛选或数据变化时回到第 1 页。`/org/*` 的独立表格、页签和下钻明细均用此分页规则;已加载的树形表格按根节点分页,子节点不拆散;接口已分页时沿用原查询与总数。
- 受控分页须实现条数回调(或兼容的统一变更回调)才显示条数选择,不用客户端切片模拟固定条数的服务端接口;分页启用且有结果时单页也显示分页栏。
## 7. 表单项
@@ -245,8 +246,8 @@ html.dark .km-page {
组件分层(antd 原生、中心封装、契约封装、专用组件)及选用方式见 `DEV_STANDARDS.md` 2.1、2.2 节。`src/components/ui/*` 只做视图映射,不放请求、权限与业务状态。
- 禁止导入:`@lobehub/*`、Radix UI、Floating UI、Semi、MUI、Chakra、Headless UI、leva、antd-style、react-layout-kit(`eslint.config.cjs` 的 `no-restricted-imports`)。
- `npm run check:ui` 审计源码导入、完整 lock 图与品牌图标资产 hash,已包含在 `npm run check` 中。
- 禁用范围见开发规范第 2.4 节;ESLint 与 `npm run check:ui` 共用一份规则,本地品牌图标不是运行时 UI 依赖。
- `npm run check:ui` 审计根目录 JS 配置、应用源码、脚本和单测的包引用,并检查依赖声明、锁文件中的传递包和别名,以及品牌图标资产 SHA-256。命令已包含在 `npm run check` 中。
- `antd` 与 `@ant-design/icons` 精确锁定版本;`src/components/ui/antd-v5-compat.css` 统一标签间距、分页选择器宽度与必填标记字体,页面样式可以覆盖。
- 当前版本 API 约定:Card 用 `variant`,Drawer 用 `size`,弹层遮罩用 `mask` 配置,Alert 标题用 `title`;样式选择器使用 `.ant-modal-container`、`.ant-alert-title`、`.ant-collapse-body`。聊天消息列表使用 `List`(antd 已标记弃用),替换前需先建立该区域的视觉基线。
+7 -6
View File
@@ -12,8 +12,8 @@
| --- | --- |
| 路由 | `/user-center/key-management`,旧 `/key-management` 重定向 |
| 视图 | `KeyManagement/index.jsx` + `key-management.css`;编辑抽屉由 `EditTokenModal presentation='drawer'` 渲染 |
| 业务 | `useTokensData`、`/api/token*`、`buildTokenPayload`、启停与删除确认不变 |
| 列表 | 固定列宽,每页 5 条;列设置不持久化 |
| 业务 | `useTokensData` 负责后端查询与分页;`buildTokenPayload`、启停与删除确认不变 |
| 列表 | 固定列宽,默认每页 10 条;列设置不持久化 |
| 抽屉 | 模型列表 440px;创建 / 编辑 560px(移动 100%) |
| 外壳 | 页头与边距按 `GLOBAL_UI_BASELINE.md` 4.4 |
@@ -27,7 +27,7 @@
| `src/pages/KeyManagement/key-management.css` | 页面作用域样式与 `--km-*` 变量 |
| `src/components/table/tokens/modals/EditTokenDrawer.jsx` | 创建 / 编辑抽屉视图 |
| `src/components/table/tokens/modals/EditTokenModal.jsx` | 状态、`formApi`、`submit`、`buildTokenPayload`;`presentation='drawer'` 时渲染抽屉 |
| `src/hooks/tokens/useTokensData.jsx` | 列表、搜索、分页、启停、删除(不改) |
| `src/hooks/tokens/useTokensData.jsx` | 列表、搜索、分页、启停、删除 |
独立路由形态(`.km-page-standalone`)只补顶栏偏移(桌面 100px、移动 80px)。
@@ -36,8 +36,8 @@
| 区域 | 规则 |
| --- | --- |
| 页头 | `UserCenterPageHeader`;“新手教程 / 查看操作指引”图标按钮保留在右侧 |
| 查询卡 | 单字段:标签 + `Input allowClear`(宽 620px)+“重置”“搜索”;卡片上下内边距 22px,描边 `#f0f0f0`(深色 `--border-subtle`) |
| 列表 | `Table size='middle' tableLayout='fixed'`,列宽 150 / 300 / 150 / 100 / 180 / 100 / 100 / 130;每页 5 条;列设置用 `ColumnSettings`,不持久化 |
| 查询卡 | 保留单输入框,匹配密钥名称、Key 或分组。输入防抖,点击搜索或按回车立即提交,重置取消待提交条件并回到普通列表第 1 页 |
| 列表 | `Table size='middle' tableLayout='fixed'`,列宽 150 / 300 / 150 / 100 / 180 / 100 / 100 / 130;默认每页 10 条;列设置用 `ColumnSettings`,不持久化 |
| 状态 | `Switch`(`onChange` 仍走原 `Modal.confirm` → `manageToken`);已过期 / 已耗尽另显示语义 `Tag` |
| 分组 | `Tag color='blue'` 无边框 + `Tooltip`;额度为 `Tag color='success'` |
| 密钥 | `<code>` 密钥框(底 `#f4f6f9`、描边 `#e4e9ee`,深色引用 `--surface-bg-base` / `--border-subtle`)+ 显示、隐藏、复制图标按钮 + `Tooltip`;脱敏提示 `Alert type='success'` |
@@ -48,7 +48,8 @@
## 3. 保留功能与已知差异
- 默认名称 `claudeNN`、每页 5 条、过去日期禁用为业务默认;“搜索”与回车即时生效。
- 默认名称 `claudeNN`、过去日期禁用为业务默认。
- 普通列表通过 `/api/token/` 服务端分页。个人搜索接口当前不支持单条件同时匹配名称、Key 和分组,也不提供分页结果;为保持原有条件,搜索复用个人列表接口取全后本地匹配和分页,不调用控制台管理接口。未取全时不展示部分搜索结果。
- 技能注入关闭时“绑定技能”字段仅隐藏,仍注册在表单中,载荷不变。
- 模型抽屉不显示来源说明行;“自定义”过期选项选中时仅文字变主色。
- 第三方新手引导(Joyride)沿用其自身配色配置。
+2 -69
View File
@@ -1,24 +1,8 @@
const globals = require('globals');
const { rules: headerRules } = require('eslint-plugin-header');
const react = require('eslint-plugin-react');
const reactHooks = require('eslint-plugin-react-hooks');
const unusedImports = require('eslint-plugin-unused-imports');
const headerRule = headerRules.header;
const header = {
rules: {
header: {
...headerRule,
meta: {
...headerRule.meta,
schema: [
{ enum: ['block', 'line'] },
{ type: 'array', items: { type: 'string' } },
],
},
},
},
};
const { uiDependencyConfig } = require('./scripts/ui-dependency-policy.cjs');
module.exports = [
{
@@ -34,6 +18,7 @@ module.exports = [
'src/assets/brand-icons/*.js',
],
},
uiDependencyConfig,
{
files: ['**/*.{js,jsx}'],
linterOptions: { reportUnusedDisableDirectives: 'off' },
@@ -45,63 +30,11 @@ module.exports = [
},
settings: { react: { version: 'detect' } },
plugins: {
header,
react,
'react-hooks': reactHooks,
'unused-imports': unusedImports,
},
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: [
'@radix-ui/*',
'@floating-ui/*',
'@lobehub/ui',
'@lobehub/ui/*',
'@lobehub/icons',
'@lobehub/icons/*',
'@douyinfe/semi-*',
'@headlessui/*',
'@mui/*',
'@chakra-ui/*',
'leva',
'leva/*',
'antd-style',
'react-layout-kit',
],
message:
'Use antd public APIs or the audited local brand SVG assets. Preserve legacy components/ui callback contracts.',
},
],
},
],
'header/header': [
2,
'block',
[
'',
'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',
'',
],
],
'no-multiple-empty-lines': ['error', { max: 1 }],
// ===== 防线:杜绝“用了未定义/未导入标识符”导致的运行时崩溃(本次线上事故根因)=====
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { defineConfig } from 'i18next-cli';
/** @type {import('i18next-cli').I18nextToolkitConfig} */
-11
View File
@@ -57,7 +57,6 @@
"autoprefixer": "^10.4.21",
"esbuild": "0.21.5",
"eslint": "9.39.5",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-unused-imports": "4.4.1",
@@ -5947,16 +5946,6 @@
}
}
},
"node_modules/eslint-plugin-header": {
"version": "3.1.1",
"resolved": "https://registry.npmmirror.com/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz",
"integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==",
"dev": true,
"license": "MIT",
"peerDependencies": {
"eslint": ">=7.7.0"
}
},
"node_modules/eslint-plugin-react": {
"version": "7.37.5",
"resolved": "https://registry.npmmirror.com/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz",
-1
View File
@@ -91,7 +91,6 @@
"autoprefixer": "^10.4.21",
"esbuild": "0.21.5",
"eslint": "9.39.5",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-unused-imports": "4.4.1",
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { defineConfig } from '@playwright/test';
import {
browserChannel,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
export default {
plugins: {
tailwindcss: {},
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
// 有头 Chrome 焦点守卫:唯一页面、禁止新建 / 切换标签页、后台建页兜底、前台状态检测。
// 规则见 docs/ui/GLOBAL_UI_BASELINE.md 第 7.1 节。
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { readFileSync } from 'node:fs';
import { createHash } from 'node:crypto';
import { devices } from '@playwright/test';
+47 -63
View File
@@ -3,20 +3,28 @@ import { createHash } from 'node:crypto';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { Linter } from 'eslint';
import policy from './ui-dependency-policy.cjs';
const root = fileURLToPath(new URL('../', import.meta.url));
const forbidden = [
/^@radix-ui\//,
/^@floating-ui\//,
/^@lobehub\/(?:ui|icons)(?:\/|$)/,
/^@douyinfe\/semi-(?:ui|icons|foundation)(?:\/|$)/,
/^@headlessui\//,
/^@mui\//,
/^@chakra-ui\//,
/^(?:leva|antd-style|react-layout-kit)(?:\/|$)/,
];
export const isForbiddenUiDependency = (name) =>
forbidden.some((pattern) => pattern.test(name));
const { isForbiddenUiDependency, uiDependencyConfig } = policy;
const linter = new Linter({ cwd: root });
const sourceConfig = [uiDependencyConfig];
const sourceDirectories = new Set(['src', 'scripts', 'test', 'tests']);
const excludedDirectories = new Set([
'node_modules',
'dist',
'dist-ssr',
'build',
'coverage',
'report',
'logs',
'test-results',
'playwright-report',
'blob-report',
'kt_batches',
'kt_out',
]);
export { isForbiddenUiDependency };
export function auditManifest(manifest, lock) {
const issues = [];
@@ -26,14 +34,22 @@ export function auditManifest(manifest, lock) {
'optionalDependencies',
'peerDependencies',
]) {
for (const name of Object.keys(manifest[section] || {})) {
if (isForbiddenUiDependency(name))
for (const [name, specifier] of Object.entries(manifest[section] || {})) {
const alias = /^npm:((?:@[^/]+\/)?[^@/]+)(?:@|$)/.exec(specifier)?.[1];
if (isForbiddenUiDependency(name)) {
issues.push(`package.json ${section}: ${name}`);
} else if (isForbiddenUiDependency(alias)) {
issues.push(`package.json ${section}: ${name} -> ${alias}`);
}
}
}
for (const location of Object.keys(lock.packages || {})) {
if (isForbiddenUiDependency(location.split('node_modules/').at(-1))) {
for (const [location, entry] of Object.entries(lock.packages || {})) {
const names = location.split(/(?:^|\/)node_modules\//);
if (names.length === 1) continue;
if (isForbiddenUiDependency(names.at(-1))) {
issues.push(`package-lock.json: ${location}`);
} else if (isForbiddenUiDependency(entry.name)) {
issues.push(`package-lock.json: ${location} -> ${entry.name}`);
}
}
if (!lock.packages || lock.lockfileVersion < 2)
@@ -42,58 +58,26 @@ export function auditManifest(manifest, lock) {
}
export function auditSource(source, filename) {
const linter = new Linter({ configType: 'eslintrc' });
linter.defineRule('ui-dependencies', {
create(context) {
const inspect = (node) => {
if (
node?.type === 'Literal' &&
typeof node.value === 'string' &&
isForbiddenUiDependency(node.value)
) {
context.report({
node,
message: `Use Ant Design or the audited local brand assets: ${node.value}`,
});
}
};
return {
ImportDeclaration: (node) => inspect(node.source),
ExportNamedDeclaration: (node) => inspect(node.source),
ExportAllDeclaration: (node) => inspect(node.source),
ImportExpression: (node) => inspect(node.source),
CallExpression: (node) => {
if (
node.callee.type === 'Identifier' &&
node.callee.name === 'require'
)
inspect(node.arguments[0]);
},
};
},
});
return linter
.verify(
source,
{
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
rules: { 'ui-dependencies': 'error' },
},
{ filename, allowInlineConfig: false },
)
.verify(source, sourceConfig, { filename, allowInlineConfig: false })
.map((issue) => `${filename}:${issue.line}: ${issue.message}`);
}
async function sourceFiles(dir) {
async function sourceFiles(dir, isRoot = true) {
const files = [];
for (const entry of await readdir(dir, { withFileTypes: true })) {
const name = path.join(dir, entry.name);
if (entry.isDirectory()) files.push(...(await sourceFiles(name)));
else if (/\.[cm]?[jt]sx?$/.test(entry.name)) files.push(name);
if (entry.isDirectory()) {
if (
isRoot
? sourceDirectories.has(entry.name)
: !entry.name.startsWith('.') && !excludedDirectories.has(entry.name)
) {
files.push(...(await sourceFiles(name, false)));
}
} else if (entry.isFile() && /\.(?:js|jsx|cjs|mjs)$/.test(entry.name)) {
files.push(name);
}
}
return files;
}
@@ -106,7 +90,7 @@ export async function checkUiDependencies(directory = root) {
await readFile(path.join(directory, 'package-lock.json'), 'utf8'),
);
const issues = auditManifest(manifest, lock);
const files = await sourceFiles(path.join(directory, 'src'));
const files = await sourceFiles(directory);
for (const filename of files) {
issues.push(
...auditSource(
@@ -143,7 +127,7 @@ export async function checkUiDependencies(directory = root) {
return {
issues,
files: files.length,
packages: Object.keys(lock.packages).length - 1,
packages: Math.max(0, Object.keys(lock.packages || {}).length - 1),
};
}
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { readFile, readdir } from 'node:fs/promises';
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
+2 -2
View File
@@ -3,7 +3,7 @@
// 找出会溢出的具体位置。控制台是围绕中文两字标签设计的,泰语平均膨胀 3.16x,
// 短标签最高 9x,密集表格首当其冲。
//
// 判据:Semi 的 Table column `width: N`(px)在 14px 字号下大致可容
// 判据:表格列的 `width: N`(px)在 14px 字号下大致可容
// 中文 ≈ N/14 字,拉丁/泰文 ≈ N/7.5 字符(泰文含上下叠加符号,按拉丁估更保守)。
// 超出即报,按超出比例排序。这是静态估算,不替代真机目视走查。
const fs = require('fs');
@@ -20,7 +20,7 @@ const DICTS = LANGS.map((l) => [l, load(l)]);
const PX_PER_CHAR = 7.5; // 拼音文字/韩/泰在 14px 下的保守平均字宽
// 日文假名与汉字、繁体中文都是全角,按字号整宽计
const PX_PER_CHAR_BY_LANG = { ja: 14, 'zh-TW': 14 };
const PADDING = 24; // Semi 表头左右内边距 + 排序图标余量
const PADDING = 24; // 表头左右内边距及排序图标的估算余量
function walk(dir, files = []) {
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
// 有头 Chrome 焦点守卫:唯一页面、禁止新建 / 切换标签页、后台建页兜底、前台状态检测。
// 规则见 docs/ui/GLOBAL_UI_BASELINE.md 第 7.1 节。
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
const FOCUS_ANNOTATION = 'focus-guard';
export default class AcceptanceReporter {
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
// 浏览器焦点守护:有头真实 Chrome 运行时尽最大可能不抢占用户桌面焦点。
// - 唯一页面:每个用例只有一个页面,由 CDP Target.createTarget({ background: true }) 后台创建,
// 不走 context.newPage()(Playwright 内部创建时不带 background,会以前台方式打开窗口)。
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { randomUUID } from 'node:crypto';
export const browserStabilityArgs = Object.freeze([
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { test as base, expect } from '@playwright/test';
import {
checkFocus,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { preview } from 'vite';
import { fileURLToPath } from 'node:url';
import { positiveInteger } from './playwright-runtime.mjs';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import path from 'node:path';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { spawn } from 'node:child_process';
import { readdir, stat, access } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { mkdtemp, writeFile, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import path from 'node:path';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { readdir } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
+64
View File
@@ -0,0 +1,64 @@
const forbiddenPackages = [
/^@(?:radix-ui|floating-ui|lobehub|headlessui|mui|material-ui|chakra-ui)\//,
/^@douyinfe\/semi-/,
/^(?:leva|antd-style|react-layout-kit)(?:[/?#]|$)/,
];
function isForbiddenUiDependency(specifier) {
return (
typeof specifier === 'string' &&
forbiddenPackages.some((pattern) => pattern.test(specifier))
);
}
const rule = {
meta: {
schema: [],
messages: {
forbidden:
'Use Ant Design or the audited local brand assets instead of {{specifier}}.',
},
},
create(context) {
const inspect = (node) => {
const specifier =
node?.type === 'Literal'
? node.value
: node?.type === 'TemplateLiteral' && node.expressions.length === 0
? node.quasis[0].value.cooked
: null;
if (isForbiddenUiDependency(specifier)) {
context.report({ node, messageId: 'forbidden', data: { specifier } });
}
};
return {
ImportDeclaration: (node) => inspect(node.source),
ExportNamedDeclaration: (node) => inspect(node.source),
ExportAllDeclaration: (node) => inspect(node.source),
ImportExpression: (node) => inspect(node.source),
CallExpression: (node) => {
const { callee } = node;
const isRequire =
callee.type === 'Identifier' && callee.name === 'require';
const isRequireResolve =
callee.type === 'MemberExpression' &&
!callee.computed &&
callee.object.type === 'Identifier' &&
callee.object.name === 'require' &&
callee.property.name === 'resolve';
if (isRequire || isRequireResolve) inspect(node.arguments[0]);
},
};
},
};
const uiDependencyConfig = {
files: ['**/*.{js,jsx,cjs,mjs}'],
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
plugins: { 'ui-dependencies': { rules: { 'no-legacy-ui': rule } } },
rules: { 'ui-dependencies/no-legacy-ui': 'error' },
};
module.exports = { isForbiddenUiDependency, uiDependencyConfig };
+81 -26
View File
@@ -1,27 +1,77 @@
/*
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
*/
import { readFile, access } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { gzipSync } from 'node:zlib';
export async function verifyBuild(directory) {
const BOOTSTRAP_GZIP_LIMIT = 820 * 1024;
const NOTICE = 'src/components/layout/NoticeModal.jsx';
const AGREEMENT = 'src/components/common/DocumentRenderer/AgreementModal.jsx';
const HEADER = 'src/components/layout/headerbar/index.jsx';
const HOME = 'src/pages/Home/index.jsx';
const MARKED = 'node_modules/marked/lib/marked.esm.js';
function resolveAsset(root, asset) {
const filename = path.resolve(root, asset.replace(/^\//, ''));
if (!filename.startsWith(root + path.sep))
throw new Error(`Build asset escapes output directory: ${asset}`);
return filename;
}
function staticChunks(manifest, roots) {
const seen = new Set();
const visit = (key) => {
if (seen.has(key)) return;
const chunk = manifest[key];
if (!chunk) throw new Error(`Missing build manifest chunk: ${key}`);
seen.add(key);
for (const dependency of chunk.imports || []) visit(dependency);
};
roots.forEach(visit);
return seen;
}
async function verifyStartup(root) {
const manifest = JSON.parse(
await readFile(path.join(root, '.vite', 'manifest.json'), 'utf8'),
);
const entry = 'index.html';
for (const [routes, deferred] of [
[
[entry, HOME, HEADER],
[NOTICE, MARKED],
],
[
[entry, 'src/components/auth/LoginForm.jsx', HEADER],
[AGREEMENT, NOTICE],
],
[
[entry, 'src/components/auth/RegisterForm.jsx', HEADER],
[AGREEMENT, NOTICE],
],
]) {
const eager = staticChunks(manifest, routes);
for (const feature of deferred) {
if (!manifest[feature]?.isDynamicEntry || eager.has(feature))
throw new Error(`Expected an independent lazy chunk: ${feature}`);
}
}
const files = new Set(
[...staticChunks(manifest, [entry])].map((key) => manifest[key].file),
);
let bootstrapGzipBytes = 0;
for (const file of files) {
const source = await readFile(resolveAsset(root, file));
bootstrapGzipBytes += gzipSync(source).length;
}
if (bootstrapGzipBytes > BOOTSTRAP_GZIP_LIMIT)
throw new Error(
`Bootstrap JS exceeds 820 KiB gzip: ${bootstrapGzipBytes} B`,
);
return { bootstrapGzipBytes, bootstrapChunks: files.size };
}
export async function verifyBuild(directory, { startup = false } = {}) {
const root = path.resolve(directory);
const html = await readFile(path.join(root, 'index.html'), 'utf8');
// Inspect actual resource tags, not URLs embedded in comments or inline scripts.
@@ -40,17 +90,22 @@ export async function verifyBuild(directory) {
if (!assets.some((value) => /\.js$/.test(value)))
throw new Error('Build has no JavaScript entry');
for (const asset of assets) {
const filename = path.resolve(root, asset.replace(/^\//, ''));
if (!filename.startsWith(root + path.sep))
throw new Error(`Build asset escapes output directory: ${asset}`);
await access(filename);
await access(resolveAsset(root, asset));
}
return { root, assets: assets.length };
return {
root,
assets: assets.length,
...(startup ? await verifyStartup(root) : {}),
};
}
if (
process.argv[1] &&
path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)
) {
console.log(await verifyBuild(process.argv[2] || 'dist'));
const args = process.argv.slice(2);
const directory = args.find((argument) => argument !== '--startup') || 'dist';
console.log(
await verifyBuild(directory, { startup: args.includes('--startup') }),
);
}
+1 -22
View File
@@ -1,28 +1,8 @@
/*
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
*/
import postcss from 'postcss';
// 旧浏览器的级联层(@layer)兜底。
//
// index.css 把 Tailwind 的 base / components / utilities 整体包在原生 @layer 里,
// Semi 的按需样式也由 vitePluginSemi({ cssLayer: true }) 包进 @layer semi。
// @layer 自 Chromium 99 / Firefox 97 / Safari 15.4 才支持;更老的内核(停更的
// Edge、Win10 LTSC 自带 Edge、各类国产壳浏览器)把它当未知 at-rule 连同块内
// 全部规则一起丢弃 —— Tailwind 整体失效,页面只剩无尺寸约束的原图 logo。
@@ -91,8 +71,7 @@ export function flattenCssLayers(sources) {
roots.forEach(assertSupportedShape);
// 层外已有逐字相同的规则时,层内那份不必收:选择器与声明都一样、层外的又加载
// 在后,它在旧浏览器里必然被覆盖。Semi 的 @layer 副本整份属于这种情况
// (index.jsx 另行全量引入了层外的 semi.css),剔掉后兜底表只剩约五分之一。
// 在后,它在旧浏览器里必然被覆盖。
const unlayered = new Set();
for (const root of roots) {
root.each((node) => {
+6 -20
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React, { lazy, Suspense, useContext, useMemo } from 'react';
import { Route, Routes, Navigate, useLocation } from 'react-router-dom';
import {
@@ -24,7 +5,12 @@ import {
isMiniProgramWebView,
} from './helpers/miniProgram';
import Loading from './components/common/ui/Loading';
import { AuthRedirect, PrivateRoute, AdminRoute, RootRoute } from './helpers';
import {
AuthRedirect,
PrivateRoute,
AdminRoute,
RootRoute,
} from './helpers/auth';
import NotFound from './pages/NotFound';
import Forbidden from './pages/Forbidden';
import { StatusContext } from './context/Status';
@@ -1,21 +1,3 @@
/*
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
*/
import { formatPercent } from '../../helpers/safeDisplay';
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
@@ -1,22 +1,3 @@
/*
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
*/
import { ChevronDown as ActionChevronDown } from '@/components/common/icons/ActionIcons';
import React from 'react';
import './collapsible-panel.css';
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import { Card, Table, Button } from '@/components/ui';
import { IconDownload } from '@/components/ui/icons';
@@ -1,21 +1,3 @@
/*
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
*/
import { formatUserReference } from '../../helpers/safeDisplay';
import React, { useMemo, useState } from 'react';
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useMemo } from 'react';
import { Card } from '@/components/ui';
import { VChart } from '@visactor/react-vchart';
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useMemo, useState, useEffect } from 'react';
import { Button, Empty, Segmented, Skeleton, theme } from 'antd';
import { VChart } from '@visactor/react-vchart';
@@ -1,22 +1,3 @@
/*
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
*/
import { formatIdReference, formatPercent } from '../../helpers/safeDisplay';
import React, { useState, useCallback } from 'react';
import { Badge, Empty, Progress, Skeleton, Tag, Tooltip, theme } from 'antd';
@@ -1,21 +1,3 @@
/*
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
*/
import { formatNumber, formatPercent } from '../../helpers/safeDisplay';
import React from 'react';
@@ -1,21 +1,3 @@
/*
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
*/
import { formatUserReference } from '../../helpers/safeDisplay';
import { Trans } from 'react-i18next';
@@ -1,22 +1,3 @@
/*
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
*/
import { Trans } from 'react-i18next';
import React, { useEffect, useRef, useState } from 'react';
import {
@@ -1,22 +1,3 @@
/*
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
*/
import { I18N_TECHNICAL_TEXT } from '../../i18n/technicalText.js';
import {
formatNumber,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useMemo } from 'react';
import { Card } from '@/components/ui';
import { VChart } from '@visactor/react-vchart';
-18
View File
@@ -1,21 +1,3 @@
/*
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
*/
import {
formatIdReference,
formatUserReference,
@@ -1,21 +1,3 @@
/*
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
*/
import { formatPercent, formatRatioPercent } from '../../helpers/safeDisplay';
import React, { useMemo, useState, useEffect, useCallback } from 'react';
@@ -1,21 +1,3 @@
/*
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
*/
import {
formatNumber,
formatIdReference,
@@ -1,22 +1,3 @@
/*
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
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React from 'react';
import {
@@ -518,11 +499,7 @@ export const ActionCenter = ({ lists, activeTab, onTabChange, cny, t }) => (
rowKey='org_id'
size='small'
scroll={{ x: 1200 }}
pagination={
lists[tab].length > 10
? { pageSize: 10, showSizeChanger: false }
: false
}
pagination={lists[tab].length > 10 ? { pageSize: 10 } : false}
empty={<Empty description={t('暂无需要跟进的企业')} />}
/>
</TabPane>
Binary file not shown.
@@ -1,22 +1,3 @@
/*
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
*/
import { Trans } from 'react-i18next';
import { I18N_TECHNICAL_TEXT } from '../../../i18n/technicalText.js';
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
+1 -22
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React, { useMemo } from 'react';
import {
@@ -142,9 +123,7 @@ export const SalesRepTable = ({ reps, cny, onSelect, t }) => {
rowKey={(r) => r.sales_rep || '__none__'}
size='small'
scroll={{ x: 920 }}
pagination={
reps.length > 8 ? { pageSize: 8, showSizeChanger: false } : false
}
pagination={reps.length > 8 ? { pageSize: 10 } : false}
empty={<Empty description={t('暂无数据')} />}
/>
</SectionCard>
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useCallback, useMemo, useState } from 'react';
import { Button, Card, Typography } from '@/components/ui';
import { ActionCenter, ACTION_TABS } from './ActionCenter';
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import { Card, Tag, Tooltip } from '@/components/ui';
import { TrendingDown, TrendingUp } from 'lucide-react';
@@ -1,21 +1,3 @@
/*
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
*/
import {
formatIdReference,
formatPercent,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { useTranslation } from 'react-i18next';
import React from 'react';
import { Sparkles } from 'lucide-react';
@@ -1,21 +1,3 @@
/*
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
*/
import { MessageCircle as ActionMessageCircle } from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect } from 'react';
import { Avatar } from '@/components/ui';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
/**
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import { Button } from 'antd';
import { useNavigate, useSearchParams } from 'react-router-dom';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
/**
@@ -0,0 +1,15 @@
import React, { lazy, Suspense } from 'react';
const AgreementModal = lazy(
() => import('../common/DocumentRenderer/AgreementModal'),
);
export default function LazyAgreementModal(props) {
if (!props.type) return null;
return (
<Suspense fallback={null}>
<AgreementModal {...props} />
</Suspense>
);
}
+1 -20
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons';
import React, {
useContext,
@@ -72,7 +53,7 @@ import GlassCard from './GlassCard';
import AuthCardHeader from './AuthCardHeader';
import AuthLoginTabs from './AuthLoginTabs';
import AuthDivider from './AuthDivider';
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
import AgreementModal from './LazyAgreementModal';
import {
isMiniProgramWebView,
withMiniProgramLogins,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useContext, useEffect } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
@@ -1,22 +1,3 @@
/*
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
*/
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { useTranslation } from 'react-i18next';
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useEffect, useState } from 'react';
import {
API,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useEffect, useState } from 'react';
import {
API,
+1 -20
View File
@@ -1,22 +1,3 @@
/*
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
*/
import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons';
import React, {
useContext,
@@ -67,7 +48,7 @@ import AuthCardHeader from './AuthCardHeader';
import AuthLoginTabs from './AuthLoginTabs';
import AuthDivider from './AuthDivider';
import { Shield, Smartphone, QrCode } from 'lucide-react';
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
import AgreementModal from './LazyAgreementModal';
import {
isMiniProgramWebView,
withMiniProgramLogins,
-18
View File
@@ -1,21 +1,3 @@
/*
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
*/
import React from 'react';
import TelegramLoginButton from 'react-telegram-login';
-18
View File
@@ -1,21 +1,3 @@
/*
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
*/
import { Trans } from 'react-i18next';
import { API, showError } from '../../helpers';
import { Button, Card, Divider, Form, Typography } from '@/components/ui';
@@ -1,21 +1,3 @@
/*
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
*/
import React, { Suspense, lazy, useContext } from 'react';
import { StatusContext } from '../../../context/Status';
@@ -1,21 +1,3 @@
/*
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
*/
import React, { useEffect, useRef } from 'react';
import './CinematicTokenFactory.css';
@@ -1,21 +1,3 @@
/*
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
*/
import React, { useEffect, useRef } from 'react';
/**
@@ -1,22 +1,3 @@
/*
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
*/
import i18next from 'i18next';
import React from 'react';
import Loading from './ui/Loading';
@@ -1,22 +1,3 @@
/*
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
*/
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React, { useState, useCallback } from 'react';
import { Modal } from '@/components/ui';
@@ -1,22 +1,3 @@
/*
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
*/
import {
ChevronUp as ActionChevronUp,
ArrowLeft as ActionArrowLeft,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import {
OpenAI,
Claude,
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import { runInNewContext } from 'node:vm';
-18
View File
@@ -1,21 +1,3 @@
/*
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
*/
import React, { useEffect, useRef } from 'react';
const MapleBackground = () => {
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useEffect, useRef } from 'react';
import { Select, Spin, Typography, Empty, Tag, Tooltip } from '@/components/ui';
import { Lock } from 'lucide-react';
-18
View File
@@ -1,21 +1,3 @@
/*
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
*/
import React, { useEffect, useRef } from 'react';
/**
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
/**
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
/*
* PageGuide —— 企业控制台页面级「使用指引」三层体系的可复用实现。
*
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import { Breadcrumb } from 'antd';
import { useLocation } from 'react-router-dom';
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import UserCenterBreadcrumb from './UserCenterBreadcrumb';
@@ -1,22 +1,3 @@
/*
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
*/
import React, { forwardRef } from 'react';
import { Avatar, theme } from 'antd';
@@ -1,22 +1,3 @@
/*
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
*/
import React, { forwardRef } from 'react';
export default forwardRef(function IconCombine(
@@ -1,22 +1,3 @@
/*
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
*/
import { useActualTheme } from '../../../context/Theme';
// Dify and Moonshot variants read the existing app theme without a second provider.
@@ -1,22 +1,3 @@
/*
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
*/
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Button, Modal } from '@/components/ui';
@@ -1,22 +1,3 @@
/*
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
*/
import React, { forwardRef } from 'react';
import {
AccountBookOutlined,
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
// 微信图标 (已经存在于 WeChatIcon.jsx,但为了统一导入,这里也提供)
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
// ========== 无结果插图 ==========
@@ -1,21 +1,3 @@
/*
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
*/
import React from 'react';
const DiscordIcon = ({ style = {}, ...props }) => {
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import './DolphinLogo.css';
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import { Icon } from '@/components/ui';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import { Icon } from '@/components/ui';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import { Icon } from '@/components/ui';
-19
View File
@@ -1,22 +1,3 @@
/*
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
*/
import React from 'react';
import './WeeLogo.css';
@@ -1,22 +1,3 @@
/*
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
*/
import { useEffectEvent } from '../../../hooks/common/useEffectEvent';
import ReactMarkdown from 'react-markdown';
import 'katex/dist/katex.min.css';
@@ -1,21 +1,3 @@
/*
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
*/
import {
X as ActionX,
ArrowRight as ActionArrowRight,

Some files were not shown because too many files have changed in this diff Show More