From 74ca103334a11c813fc10b7db73ff2ec6ca37825 Mon Sep 17 00:00:00 2001
From: zhanjunhao <642307404@qq.com>
Date: Thu, 19 Nov 2026 23:09:58 +0800
Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E7=BB=9F=E4=B8=80=E8=A1=A8=E6=A0=BC?=
=?UTF-8?q?=E7=AD=9B=E9=80=89=E5=88=86=E9=A1=B5=E5=92=8C=E7=94=A8=E9=87=8F?=
=?UTF-8?q?=E6=98=8E=E7=BB=86=EF=BC=8C=E5=8D=87=E7=BA=A7=20ESLint?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.eslintrc.cjs | 106 ----
README.md | 2 +-
docs/CHANGELOG.md | 48 ++
docs/standards/UI_COMPONENT_STANDARDS.md | 12 +-
docs/ui/ORG_CENTER_SPEC.md | 14 +-
eslint.config.cjs | 133 +++++
package-lock.json | 484 +++++++++---------
package.json | 8 +-
scripts/check-ui-dependencies.mjs | 2 +-
src/components/console/ConsoleCollection.jsx | 37 +-
src/components/console/ConsolePrimitives.jsx | 40 +-
src/components/console/console.css | 4 +-
.../settings/CustomerServiceSetting.jsx | 46 +-
.../settings/LevelPolicySetting.jsx | 52 +-
.../settings/TutorialVideoSetting.jsx | 40 +-
src/components/smart-router/DecisionTable.jsx | 20 +-
src/components/smart-router/ProfileTable.jsx | 64 ++-
.../table/admin-tokens/AdminTokensFilters.jsx | 166 +++---
.../table/admin-tokens/admin-tokens.css | 46 +-
.../table/channels/ChannelsColumnDefs.jsx | 235 +++++----
.../table/models/ModelsColumnDefs.jsx | 102 ++--
.../table/redemptions/RedemptionsActions.jsx | 15 +-
.../redemptions/RedemptionsColumnDefs.jsx | 101 ++--
.../table/tokens/TokensColumnDefs.jsx | 142 ++---
src/components/table/usage-logs/UsageLogs.css | 23 +
.../table/usage-logs/UsageLogsColumnDefs.jsx | 132 +----
.../table/usage-logs/UsageLogsTable.jsx | 4 +-
src/components/ui/index.jsx | 10 +-
src/components/ui/pagination.js | 4 +-
src/pages/AdminInvoice/index.jsx | 124 +++--
src/pages/AdminOrganizations/index.jsx | 147 +++---
src/pages/CommissionV2/LatestTierPanel.jsx | 10 +-
src/pages/CommissionV2/ListPanel.jsx | 236 +++++----
src/pages/CommissionV2/PartnerDetail.jsx | 2 +-
src/pages/CommissionV2/PartnerPortal.jsx | 439 ++++++++++------
src/pages/CommissionV2/index.jsx | 305 ++++++-----
src/pages/CommissionV2/latestTiers.js | 6 +-
src/pages/CommissionV2/latestTiers.test.js | 6 +-
src/pages/CommissionV2/operations.jsx | 2 +-
src/pages/CommissionV2/styles.css | 24 +-
.../AICreation/Video/VideoTaskQueue.jsx | 109 ++--
src/pages/KeyManagement/index.jsx | 68 ++-
src/pages/KeyManagement/key-management.css | 28 -
src/pages/Organization/OrgAudit.jsx | 44 +-
src/pages/Organization/OrgBudgets.jsx | 2 +-
src/pages/Organization/OrgDashboard.jsx | 57 +--
src/pages/Organization/OrgDeptManage.jsx | 4 +-
src/pages/Organization/OrgEffectiveness.jsx | 8 +-
src/pages/Organization/OrgLogs.jsx | 3 +-
src/pages/Organization/OrgMemberAccounts.jsx | 104 ++--
src/pages/Organization/OrgMembers.jsx | 113 ++--
src/pages/Organization/OrgPrivateSkills.jsx | 218 ++++----
src/pages/Organization/OrgProjectManage.jsx | 2 +-
src/pages/Organization/OrgProjects.jsx | 60 +--
src/pages/Organization/OrgPromptRecords.jsx | 21 +-
src/pages/Organization/OrgRequests.jsx | 3 +-
.../Organization/OrgSkillAssignments.jsx | 2 +-
src/pages/Organization/OrgTokens.jsx | 11 +-
.../components/OrgAnalyticsPanel.jsx | 16 +-
.../components/OrgScopedLimitButtons.jsx | 83 ++-
.../components/OrgTaskRecords.jsx | 31 +-
.../Organization/datasecurity/OrgDsRules.jsx | 4 +-
.../Organization/fund/DeptFundsPanel.jsx | 57 +--
.../Organization/fund/FundLedgerSheet.jsx | 14 +-
src/pages/Organization/fund/OrgDeptFunds.jsx | 57 +--
.../Payment/SettingsPaymentGatewayPayPal.jsx | 76 +--
.../Setting/WeyAi/SettingsWeyAiContent.jsx | 95 ++--
.../WeyAi/SettingsWeyAiReleaseNotes.jsx | 69 +--
src/pages/Subscription/index.jsx | 114 +++--
src/pages/UserCenter/UsageRecord.css | 14 -
src/pages/WebsiteSettings/InsightsPanel.jsx | 61 ++-
src/styles/org-center.css | 4 +-
test/unit/fixtures/unpaginated-tables.json | 15 +-
test/unit/pagination.test.js | 2 +-
test/unit/settings-ui.test.js | 2 +
tests/console-layout.test.js | 2 +
76 files changed, 2556 insertions(+), 2410 deletions(-)
delete mode 100644 .eslintrc.cjs
create mode 100644 eslint.config.cjs
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
deleted file mode 100644
index b80a005f..00000000
--- a/.eslintrc.cjs
+++ /dev/null
@@ -1,106 +0,0 @@
-module.exports = {
- root: true,
- env: { browser: true, es2021: true, node: true },
- parserOptions: {
- ecmaVersion: 2022,
- sourceType: 'module',
- ecmaFeatures: { jsx: true },
- },
- settings: {
- react: { version: 'detect' },
- },
- plugins: ['header', 'react-hooks', 'react', 'unused-imports'],
- ignorePatterns: [
- 'dist/**',
- 'node_modules/**',
- 'logs/**',
- 'report/**',
- 'playwright-report/**',
- 'test-results/**',
- 'blob-report/**',
- 'src/assets/brand-icons/*.js',
- ],
- overrides: [
- {
- files: ['**/*.{js,jsx}'],
- 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 .',
- '',
- 'For commercial licensing, please contact support@quantumnous.com',
- '',
- ],
- ],
- 'no-multiple-empty-lines': ['error', { max: 1 }],
-
- // ===== 防线:杜绝“用了未定义/未导入标识符”导致的运行时崩溃(本次线上事故根因)=====
- // 让规则识别 JSX 中使用到的组件/React,避免误报。
- 'react/jsx-uses-vars': 'error',
- 'react/jsx-uses-react': 'error',
- // 未定义标识符 = 直接报错(构建/CI 即拦截)。
- 'no-undef': 'error',
- // 未使用的 import = error 且可 --fix 自动移除(含 JSX/副作用识别);
- // 未使用的变量 = warn(不阻断,下划线前缀豁免)。
- 'no-unused-vars': 'off',
- 'unused-imports/no-unused-imports': 'error',
- 'unused-imports/no-unused-vars': [
- 'warn',
- {
- vars: 'all',
- varsIgnorePattern: '^_',
- args: 'none',
- argsIgnorePattern: '^_',
- ignoreRestSiblings: true,
- },
- ],
- // React Hooks 规则。
- 'react-hooks/rules-of-hooks': 'error',
- 'react-hooks/exhaustive-deps': 'warn',
- },
- },
- ],
-};
diff --git a/README.md b/README.md
index 7e6f22dc..b0190b6b 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ npm run dev
/api /v1 /v1beta /mj /pg /dashboard /kling /jimeng /suno
```
-切换联调后端时修改 `.env.development.local` 中的 `DEV_PROXY_TARGET` 并重启服务;该变量只供 Vite 代理使用,不会暴露给浏览器。生产环境需由 Nginx 或网关配置同源反向代理,`package.json` 中的 `proxy` 字段不生效。
+切换联调后端时修改 `.env.development.local` 中的 `DEV_PROXY_TARGET` 并重启服务;该变量只供 Vite 代理使用,不会暴露给浏览器。生产环境需由 Nginx 或网关配置同源反向代理,Vite 开发代理不会进入生产产物。
### 可选:直接访问独立后端域名
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 85e2da95..4807075d 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -10,6 +10,54 @@
## 2026-11-19
+### 更新 · ESLint 9
+
+- **范围**:JavaScript / JSX 静态检查与 UI 依赖审计。
+- **变更**:升级至 ESLint 9.39.5 并迁移为扁平配置,保留原有检查规则。
+- **影响**:不改变应用运行时依赖。
+- **回滚**:同步还原配置、依赖锁文件和 UI 审计脚本的本条差异。
+- **关联**:`eslint.config.cjs`、`scripts/check-ui-dependencies.mjs`。
+
+### 调整 · 对齐操作审计筛选栏
+
+- **范围**:企业审计日志的「操作审计」页签。
+- **变更**:复用用户中心密钥管理的筛选表单布局、按钮与移动端折叠。
+- **影响**:保留操作类型、选择即筛选、重置、搜索和刷新逻辑;不影响「提示词记录」。
+- **回滚**:仅还原本条涉及的操作审计筛选栏改动。
+- **关联**:`src/pages/Organization/OrgAudit.jsx`。
+
+### 调整 · 收窄表格「更多」菜单的使用范围
+
+- **范围**:此前接入公共行操作菜单的表格。
+- **变更**:仅用户列表与合作伙伴列表保留新版「更多」,其他列表恢复原操作入口。
+- **影响**:保留现有权限、业务回调、筛选、分页及空态。
+- **回滚**:仅还原本条菜单差异,不覆盖其他页面改动。
+- **关联**:`src/components/common/table/TableToolbar.jsx`、`docs/standards/UI_COMPONENT_STANDARDS.md`。
+
+### 调整 · 企业表格分页与用量明细对齐
+
+- **范围**:企业中心表格、企业密钥列表、用户中心调用明细及控制台使用明细。
+- **变更**:企业表格统一底部分页;密钥表按可见列宽度滚动;两端共用「用时 / 首字」标签和居中样式,调用明细与使用明细的操作入口均显示「详情」。
+- **影响**:前端分页不追加请求,接口分页沿用原有查询,树形数据保留父子关系。
+- **回滚**:只还原本条涉及的企业列表、分页适配和用量明细改动。
+- **关联**:`docs/ui/ORG_CENTER_SPEC.md`、`src/components/table/usage-logs/UsageLogsColumnDefs.jsx`。
+
+### 调整 · 列表筛选、工具栏及分页对齐密钥管理
+
+- **范围**:平台、企业、个人分佣,兑换码、会员卡、发票和用户中心密钥管理,含页签及明细表格。
+- **变更**:共享搜索按钮、筛选栅格和工具栏布局,统一分页总数、每页条数与切换行为。
+- **影响**:保留现有权限、接口用途和即时筛选;分佣档位每页条数传入列表请求,导出仍读取完整结果。
+- **回滚**:只还原本条所列的组件、分页和规范改动。
+- **关联**:`docs/standards/UI_COMPONENT_STANDARDS.md`、`src/components/console/ConsoleCollection.jsx`。
+
+### 清理 · 移除无效的旧代理配置
+
+- **范围**:前端包配置与联调说明。
+- **变更**:删除 `package.json` 中 Vite 不读取的 `proxy` 字段。
+- **影响**:不改变依赖、锁文件、本地联调后端或生产网关。
+- **回滚**:仅还原本条涉及的包配置与文档。
+- **关联**:`package.json`、`vite.config.js`、`README.md`。
+
### 修复 · 并发请求失败与会话过期提示
- **范围**:统一请求工具、登录入口及企业预算的关联查询。
diff --git a/docs/standards/UI_COMPONENT_STANDARDS.md b/docs/standards/UI_COMPONENT_STANDARDS.md
index 6b4c9470..bdcc1a2f 100644
--- a/docs/standards/UI_COMPONENT_STANDARDS.md
+++ b/docs/standards/UI_COMPONENT_STANDARDS.md
@@ -132,7 +132,9 @@ html.dark .km-page {
- 行为:搜索与重置都回到第 1 页;重置 = 清空表单 + 以默认条件重新查询;只切换筛选的页签放在筛选卡上方。
- 移动端:用户中心与控制台默认收起,通过“显示 / 隐藏操作项”或“筛选”按钮展开;列设置入口不随筛选收起。
- 控制台使用 `ConsoleSearchBar` + `ConsoleSearchActions`,企业中心使用 `OrgFilterCard`,不要另写网格。
-- 控制台标准列表以 `/console/token` 为参考:使用 `ConsoleCollection`(或通过 `CardPro` 接入),控件走共享筛选栅格(三列、≤ 1100px 两列、≤ 768px 单列),在列表卡内单列工具栏;快捷筛选在左,批量、刷新、新建等列表动作在右。不要把列表动作插进搜索字段区,也不要为了对齐而新增无业务语义的按钮。
+- 标准列表以 `/console/token` 为参考,覆盖控制台分佣、兑换码、会员卡和发票,企业及个人分佣,以及用户中心密钥管理(含各自子页、页签和详情列表)。使用 `ConsoleCollection`(或通过 `CardPro` 接入);独立列表可用 `ConsoleCollectionSearch` + `ConsoleFilterGrid`。筛选栅格为三列、≤ 1100px 两列、≤ 768px 单列。
+- 搜索操作在筛选卡右下,先默认样式“重置”(无图标),再带放大镜的主按钮“搜索”;点击和回车共用同一个提交入口。保留原有即时筛选及请求方式,移动端统一通过“显示/隐藏操作项”切换。
+- 工具栏在列表卡内、表格上方:列表标题、计数或快捷筛选在左;已有的批量、导出、刷新、列设置、新建等动作在右,主操作尽量靠右,使用公共操作图标和清晰文案。窗口变窄时自然换行。只读明细若没有筛选或业务动作,不新增占位按钮。
## 5. 表格
@@ -150,7 +152,7 @@ html.dark .km-page {
- 每列显式 `width`,长文本 `ellipsis` 并配 `Tooltip`;金额与数量右对齐;时间统一格式,必要时日期与时间分两行。
- 状态列用 `Tag` 或 `Switch`(见第 11 节);启停开关请求中禁用,失败恢复原状态。
-- 操作列放在最后,标题固定为“操作”,按钮为 `type='link' size='small'`,同一行操作间距 8px;用户中心、企业中心、控制台(含系统设置)的操作列统一 `fixed: 'right'`。多操作列表以 `/console/commission?view=partners` 为参考:使用 `TableRowActions`,直出 1–2 个高频动作(如“详情”“编辑”),其余放进带下箭头的文字“更多”菜单。菜单点击打开、右对齐,无有效菜单项时不渲染入口;危险项置末、标记 `danger` 并保留业务确认。现有权限、状态限制、禁用项和回调不得因收纳而改变,方向键、Enter、Escape 可操作菜单。
+- 操作列放在最后,标题固定为“操作”,按钮为 `type='link' size='small'`,同一行操作间距 8px;用户中心、企业中心、控制台(含系统设置)的操作列统一 `fixed: 'right'`。`/console/user` 的用户列表和 `/console/commission?view=partners` 的合作伙伴列表使用 `TableRowActions`:直出高频动作,其余放进带下箭头的文字“更多”菜单。其他列表沿用既有操作呈现方式,不批量套用此菜单。菜单点击打开、右对齐,无有效菜单项时不渲染入口;危险项置末、标记 `danger` 并保留业务确认。现有权限、状态限制、禁用项和回调不得因收纳而改变,方向键、Enter、Escape 可操作菜单。
- 三中心表格通过 `CenterActionTable` 统一处理,最后一列存在创建、查看、编辑、测试、详情、删除、添加、设置、配置、弹窗 / 抽屉或请求交互时,列头统一显示“操作”并固定右侧,宽度按按钮 / 交互数量计算。没有操作列但估算列宽超出容器时,从右侧固定末 4 列,列数不足时降为 3、2、1 列。固定列使用不透明底色并保持表头层级;横向滚动条遵循 Ant Design 官方固定列表格行为,允许鼠标、触控板、触屏和键盘滚动,不隐藏滚动条。
- 列显隐只在已有列设置的表格中提供,统一使用 `ColumnSettings`(见 `docs/ui/TABLE_COLUMN_SETTINGS_SPEC.md`)。
- 三中心表头背景统一由 `center-table.css` 绘制:页面通过 `--center-table-head-bg` 提供色调,公共层在不透明的容器底色上叠加同色填充,普通列与固定列保持一致;页面不再直接覆盖表头 `background`。固定列使用 antd 6 的 `.ant-table-cell-fix` 与原生动态层级,不写死 `z-index`,不使用旧版 `fix-left` / `fix-right` 类名补丁;表头不换行,表头与正文沿用同一列宽和对齐方式。
@@ -168,8 +170,8 @@ html.dark .km-page {
- 位置:列表卡底部右对齐,上距 16px;移动端换行显示并提供快速跳页。
- 外观:小尺寸,可切换每页条数 `[10, 20, 50, 100]`,总数文案 `t('共 {{total}} 条', { total })`。
-- 用法:分页列表使用 `@/components/ui` 的 `Table` / `Pagination`,传 `currentPage`、`pageSize`、`total`、`onPageChange(page)`、`onPageSizeChange(size)`。`/console`、`/org` 下由封装自动统一外观与回调;其他路由需显式传 `showSizeChanger`、`pageSizeOpts`、`showTotal`,并设置 `preventPageChangeOnPageSizeChange: true`,避免改页容量时请求两次。
-- 删除当前页最后一条后回到上一页;前端分页的列表在筛选或数据变化时回到第 1 页。
+- 用法:分页列表使用 `@/components/ui` 的 `Table` / `Pagination`。第 4 节的标准列表及其明细分页均沿用密钥管理:表格底部右对齐、小尺寸,依次显示“共 N 条”、上一页/页码/下一页、每页条数(10、20、50、100),移动端保留跳页。已加载的明细可本地分页;服务端分页传 `currentPage`、`pageSize`、`total` 以及分页回调,切换每页条数回到第 1 页,只发一次请求。导出仍作用于原有结果范围,不受当前页条数影响。
+- 删除当前页最后一条后回到上一页;前端分页的列表在筛选或数据变化时回到第 1 页。`/org/*` 的独立表格、页签和下钻明细均用此分页规则;已加载的树形表格按根节点分页,子节点不拆散;接口已分页时沿用原查询与总数。
## 7. 表单项
@@ -243,7 +245,7 @@ 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(`.eslintrc.cjs` 的 `no-restricted-imports`)。
+- 禁止导入:`@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` 中。
- `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 已标记弃用),替换前需先建立该区域的视觉基线。
diff --git a/docs/ui/ORG_CENTER_SPEC.md b/docs/ui/ORG_CENTER_SPEC.md
index 99559b23..1a46da08 100644
--- a/docs/ui/ORG_CENTER_SPEC.md
+++ b/docs/ui/ORG_CENTER_SPEC.md
@@ -23,7 +23,7 @@
- 视觉依据:在线原型 `http://192.168.0.161:8888` 顶栏“企业中心”(深色用“切换至暗色主题”),只作视觉依据,不作业务、路由、数据依据。
- 只对齐背景、字体、图标、表格、表单、卡片、页签、搜索条件、操作列、弹窗、按钮、颜色、文字、间距与已有交互反馈;不改请求、载荷、状态、路由、权限与触发条件。
-- 原型有而系统无的功能不补建:员工筛选卡、CSV 导出、尺寸切换分页、新建员工 / 分配角色 / 离职、角色管理、在职 / 离职筛选、订单号搜索、分组列、发票入口。例外:企业密钥管理的分组列与列设置已按需求实现。
+- 原型有而系统无的功能不补建:员工筛选卡、CSV 导出、新建员工 / 分配角色 / 离职、角色管理、在职 / 离职筛选、订单号搜索、分组列、发票入口。例外:企业密钥管理的分组列与列设置已按需求实现。
## 2. 作用域与变量
@@ -49,7 +49,7 @@
通用卡片、筛选栏、表格、分页、弹层、页签、标签样式按 `UI_COMPONENT_STANDARDS.md`;企业中心的差异如下。
- **页头**:`OrgPageHeader`(内部复用 `UserCenterPageHeader`),规格见 `GLOBAL_UI_BASELINE.md` 4.4;页头不放操作按钮,操作移入列表卡头。面包屑分组见 4.4 第 3 条。
-- **列表卡 `OrgListCard`**:卡头与表格间距 20px;表格为紧凑变体(正文 13px,表头 12px / 500、底色 `--oc-soft`,行上下内边距 17px);分页不提供每页条数切换。
+- **列表卡 `OrgListCard`**:卡头与表格间距 20px;表格为紧凑变体(正文 13px,表头 12px / 500、底色 `--oc-soft`,行上下内边距 17px);分页按公共组件规范,覆盖页签及表格明细。
- **筛选卡 `OrgFilterCard`**:固定 3 列;筛选取值与生效时机沿用原页面(审计日志为“选择即筛选”,“搜索”以当前条件重新查询)。
- **行操作 `OrgRowActions`**:link 按钮 13 / 24px、无内边距、间距 10px,不带图标。
- **列表页签 `.oc-list-tabs`**:导航高 44px,页签内边距 12px 0,选中与悬停色为 `--oc-brand`;只切换筛选时加 `.oc-tabs-nav-only`。
@@ -66,9 +66,9 @@
| 数据看板 | `oc-dash-*` hero(健康提示“企业运行正常”、企业名、企业额度、组织概况)+ `OrgAnalyticsPanel`(汇总条、趋势 `Segmented`、分布、明细页签) | 时间范围 7 / 30 / 90 天;企业名来自 `orgInfo.name`,无值时隐藏 |
| 员工管理 | 页签(员工权限 / 员工账号)+ 列表卡;首列与操作列固定;备注独立列;状态 `Switch` | 无筛选卡与在职 / 离职页签 |
| 项目管理 | `OrgListCard` + link 操作(模型 / 分组 / 成员 / 密钥 / 编辑);状态开关 | 操作列不再显示“停用” |
-| 预算中心 | `.oc-policy` 固定说明条;列宽 300 / 110 / 260 / 120 / 120 / 130;状态开关 | 无分页 |
+| 预算中心 | `.oc-policy` 固定说明条;列宽 300 / 110 / 260 / 120 / 120 / 130;状态开关 | 已加载数据前端分页 |
| 审批中心 | 状态页签(回调 `setStatusFilter`)+ 申请列表卡;拒绝弹窗竖排表单项 | — |
-| 密钥管理 | 密钥框 + 显隐 / 复制、可用模型 link、分组列、状态开关、绝对时间;列设置用共享组件;创建 / 编辑为 560px `OrgSideSheet` | 列设置只在当前页面生效 |
+| 密钥管理 | 密钥框 + 显隐 / 复制、可用模型 link、分组列、状态开关、绝对时间;列设置用共享组件;创建 / 编辑为 560px `OrgSideSheet` | 列设置只在当前页面生效;非操作列整体横向滚动,仅在可见列宽度超过容器时显示滚动条 |
| 企业充值 | 企业钱包 + 充值工作区(额度卡 / 自定义 / 支付方式)+ 订单卡 + 记录;订单“立即充值”与支付方式点击同为 `handlePreTopUp` | 档位与折扣来自后台配置;无订单号搜索与发票入口 |
| 消耗明细 | 统计卡 + 页签(明细日志 / 成员排行 / 绘图与视频)+ 三列筛选卡 + 列表卡;查询按钮为“搜索”(`handleSearch`) | 见第 5 节 |
| 审计日志 | 页签 + 筛选卡(操作类型)+ 操作记录卡;“提示词记录”页签沿用原显隐 | — |
@@ -79,18 +79,18 @@
- 剩余额度提示按未取整占比判定:> 20% 为“可用额度充足”(`#438568`),0 < 占比 ≤ 20% 为“可用额度偏低”(`#9c6b25`),≤ 0 为“可用额度已用尽”(`#b34c4c`);数据无效时隐藏,仅作提示,不影响计费或拦截。
- 多维用量分析工具组用原生 `Select` / `Button`:维度 132px、时间 86px、刷新 34px,高 34px、间距 8px。
-- 模型明细使用已加载数据做前端分页(每页 10 条),翻页不请求接口,维度、时间或数据变化时回到第一页;表格随页面自然展开,仅窄屏横向滚动。
+- 模型明细使用已加载数据做前端分页(默认每页 10 条),翻页不请求接口,维度、时间或数据变化时回到第一页;表格随页面自然展开,仅窄屏横向滚动。
## 5. 消耗明细(/org/logs)
- 绘图与视频由 `components/OrgTaskRecords.jsx` 呈现,复用 `useTaskLogsData({ organizationMode: true })`、`TaskLogsFilters`、`getTaskLogsColumns`、`exportTaskLogsPageCsv`、`ColumnSelectorModal`、`ContentModal`;结构为筛选卡 + “任务记录”列表卡(导出本页 / 刷新 / 列设置),不渲染“本页统计”区块,移动端筛选直接展开。
-- 任务表列宽 185 / 185 / 110 / 110 / 250 / 330 / 110 / 155 / 145 / 150;模型为行内胶囊,费用主色右对齐;分页 10 / 20 / 50,“共 N 条”。“刷新”与“搜索”调用同一 `refresh`。
+- 任务表列宽 185 / 185 / 110 / 110 / 250 / 330 / 110 / 155 / 145 / 150;模型为行内胶囊,费用主色右对齐;分页沿用公共规范。“刷新”与“搜索”调用同一 `refresh`。
- 时间范围为本页签自有的可编辑字段(默认最近 7 天,含快捷预设),与“明细日志”筛选互不影响;起止颠倒沿用原提示。
- 末列“操作”不固定:视频任务显示“点击预览视频”,失败任务保留失败原因查看,其余显示“-”。
- 预览视频沿用 `ContentModal`:标题栏“视频预览”与关闭按钮、16:9 播放区、加载态、播放失败或无地址时 `Empty` 空态、页脚复制链接 / 新标签页打开 / 关闭;关闭时暂停视频,重开同一视频不残留加载指示。
- 成员排行行键使用 `user_id-名次序号`,避免后端同一成员多行时出现重复 key。
- 明细日志查询不写 URL;绘图与视频筛选沿用原有 URL 同步。
-- 保留差异:明细日志无列设置、分组列、操作列与尺寸切换;任务表无渠道 / 用户 ID 筛选、平台列、排序与任务 ID 复制。
+- 保留差异:明细日志无列设置、分组列、操作列;任务表无渠道 / 用户 ID 筛选、平台列、排序与任务 ID 复制。
## 6. 验收要点
diff --git a/eslint.config.cjs b/eslint.config.cjs
new file mode 100644
index 00000000..066fef8d
--- /dev/null
+++ b/eslint.config.cjs
@@ -0,0 +1,133 @@
+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' } },
+ ],
+ },
+ },
+ },
+};
+
+module.exports = [
+ {
+ ignores: [
+ '**/.*',
+ 'dist/**',
+ 'node_modules/**',
+ 'logs/**',
+ 'report/**',
+ 'playwright-report/**',
+ 'test-results/**',
+ 'blob-report/**',
+ 'src/assets/brand-icons/*.js',
+ ],
+ },
+ {
+ files: ['**/*.{js,jsx}'],
+ linterOptions: { reportUnusedDisableDirectives: 'off' },
+ languageOptions: {
+ ecmaVersion: 2022,
+ sourceType: 'module',
+ parserOptions: { ecmaFeatures: { jsx: true } },
+ globals: { ...globals.browser, ...globals.node, ...globals.es2021 },
+ },
+ 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 .',
+ '',
+ 'For commercial licensing, please contact support@quantumnous.com',
+ '',
+ ],
+ ],
+ 'no-multiple-empty-lines': ['error', { max: 1 }],
+
+ // ===== 防线:杜绝“用了未定义/未导入标识符”导致的运行时崩溃(本次线上事故根因)=====
+ // 让规则识别 JSX 中使用到的组件/React,避免误报。
+ 'react/jsx-uses-vars': 'error',
+ 'react/jsx-uses-react': 'error',
+ // 未定义标识符 = 直接报错(构建/CI 即拦截)。
+ 'no-undef': 'error',
+ // 未使用的 import = error 且可 --fix 自动移除(含 JSX/副作用识别);
+ // 未使用的变量 = warn(不阻断,下划线前缀豁免)。
+ 'no-unused-vars': 'off',
+ 'unused-imports/no-unused-imports': 'error',
+ 'unused-imports/no-unused-vars': [
+ 'warn',
+ {
+ vars: 'all',
+ varsIgnorePattern: '^_',
+ args: 'none',
+ caughtErrors: 'none',
+ argsIgnorePattern: '^_',
+ ignoreRestSiblings: true,
+ },
+ ],
+ // React Hooks 规则。
+ 'react-hooks/rules-of-hooks': 'error',
+ 'react-hooks/exhaustive-deps': 'warn',
+ },
+ },
+];
diff --git a/package-lock.json b/package-lock.json
index 1c9c18be..2f450034 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,11 +1,11 @@
{
- "name": "react-template",
+ "name": "monkey-ai-web",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "react-template",
+ "name": "monkey-ai-web",
"version": "0.1.0",
"dependencies": {
"@ant-design/icons": "6.3.4",
@@ -56,11 +56,12 @@
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.21",
"esbuild": "0.21.5",
- "eslint": "8.57.0",
+ "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": "^3.2.0",
+ "eslint-plugin-unused-imports": "4.4.1",
+ "globals": "16.5.0",
"i18next-cli": "^1.10.3",
"postcss": "^8.5.3",
"prettier": "^3.0.0",
@@ -961,38 +962,119 @@
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
+ "node_modules/@eslint/config-array": {
+ "version": "0.21.2",
+ "resolved": "https://registry.npmmirror.com/@eslint/config-array/-/config-array-0.21.2.tgz",
+ "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/object-schema": "^2.1.7",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.5"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/config-helpers": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmmirror.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/core": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmmirror.com/@eslint/core/-/core-0.17.0.tgz",
+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@types/json-schema": "^7.0.15"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
"node_modules/@eslint/eslintrc": {
- "version": "2.1.4",
- "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
- "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
+ "version": "3.3.7",
+ "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-3.3.7.tgz",
+ "integrity": "sha512-F42g89Qd5oAWtp0k0nnSrjziAKza7w8SVT4mStc18LZMaRb4J1HQAHLCalEtDCxrTuksx7NU9qsmeLwpOfPqWw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "ajv": "^6.12.4",
+ "ajv": "^6.14.0",
"debug": "^4.3.2",
- "espree": "^9.6.0",
- "globals": "^13.19.0",
+ "espree": "^10.0.1",
+ "globals": "^14.0.0",
"ignore": "^5.2.0",
"import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
+ "js-yaml": "^4.3.2",
+ "minimatch": "^3.1.5",
"strip-json-comments": "^3.1.1"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
- "node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmmirror.com/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
+ "node_modules/@eslint/eslintrc/node_modules/globals": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmmirror.com/globals/-/globals-14.0.0.tgz",
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
"dev": true,
"license": "MIT",
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@eslint/js": {
+ "version": "9.39.5",
+ "resolved": "https://registry.npmmirror.com/@eslint/js/-/js-9.39.5.tgz",
+ "integrity": "sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ }
+ },
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmmirror.com/@eslint/object-schema/-/object-schema-2.1.7.tgz",
+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmmirror.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0",
+ "levn": "^0.4.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/@formatjs/icu-messageformat-parser": {
@@ -1018,20 +1100,42 @@
"integrity": "sha512-I7xWjLs2YSVMc5gGx1Z3ZG1lgFpITPndpi8Ku55GeEIKpACCPQNS/OTqQbxgTCfq0Ncvcc+CrFov96itVh6Qvw==",
"license": "MIT"
},
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmmirror.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
- "deprecated": "Use @eslint/config-array instead",
+ "node_modules/@humanfs/core": {
+ "version": "0.19.2",
+ "resolved": "https://registry.npmmirror.com/@humanfs/core/-/core-0.19.2.tgz",
+ "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
- "debug": "^4.3.1",
- "minimatch": "^3.0.5"
+ "@humanfs/types": "^0.15.0"
},
"engines": {
- "node": ">=10.10.0"
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/node": {
+ "version": "0.16.8",
+ "resolved": "https://registry.npmmirror.com/@humanfs/node/-/node-0.16.8.tgz",
+ "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@humanfs/core": "^0.19.2",
+ "@humanfs/types": "^0.15.0",
+ "@humanwhocodes/retry": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/types": {
+ "version": "0.15.0",
+ "resolved": "https://registry.npmmirror.com/@humanfs/types/-/types-0.15.0.tgz",
+ "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
}
},
"node_modules/@humanwhocodes/module-importer": {
@@ -1048,13 +1152,19 @@
"url": "https://github.com/sponsors/nzakas"
}
},
- "node_modules/@humanwhocodes/object-schema": {
- "version": "2.0.3",
- "resolved": "https://registry.npmmirror.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
- "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
- "deprecated": "Use @eslint/object-schema instead",
+ "node_modules/@humanwhocodes/retry": {
+ "version": "0.4.3",
+ "resolved": "https://registry.npmmirror.com/@humanwhocodes/retry/-/retry-0.4.3.tgz",
+ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
"dev": true,
- "license": "BSD-3-Clause"
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
},
"node_modules/@iconify/types": {
"version": "2.0.0",
@@ -3369,6 +3479,13 @@
"@types/unist": "*"
}
},
+ "node_modules/@types/json-schema": {
+ "version": "7.0.15",
+ "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz",
+ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/katex": {
"version": "0.16.8",
"resolved": "https://registry.npmmirror.com/@types/katex/-/katex-0.16.8.tgz",
@@ -5438,19 +5555,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
"node_modules/docx": {
"version": "9.15.3",
"resolved": "https://registry.npmmirror.com/docx/-/docx-9.15.3.tgz",
@@ -5783,60 +5887,64 @@
}
},
"node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmmirror.com/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
+ "version": "9.39.5",
+ "resolved": "https://registry.npmmirror.com/eslint/-/eslint-9.39.5.tgz",
+ "integrity": "sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==",
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
"dev": true,
"license": "MIT",
"dependencies": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
+ "@eslint-community/eslint-utils": "^4.8.0",
+ "@eslint-community/regexpp": "^4.12.1",
+ "@eslint/config-array": "^0.21.2",
+ "@eslint/config-helpers": "^0.4.2",
+ "@eslint/core": "^0.17.0",
+ "@eslint/eslintrc": "^3.3.6",
+ "@eslint/js": "9.39.5",
+ "@eslint/plugin-kit": "^0.4.1",
+ "@humanfs/node": "^0.16.6",
"@humanwhocodes/module-importer": "^1.0.1",
- "@nodelib/fs.walk": "^1.2.8",
- "@ungap/structured-clone": "^1.2.0",
- "ajv": "^6.12.4",
+ "@humanwhocodes/retry": "^0.4.2",
+ "@types/estree": "^1.0.6",
+ "ajv": "^6.14.0",
"chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
+ "cross-spawn": "^7.0.6",
"debug": "^4.3.2",
- "doctrine": "^3.0.0",
"escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.2.2",
- "eslint-visitor-keys": "^3.4.3",
- "espree": "^9.6.1",
- "esquery": "^1.4.2",
+ "eslint-scope": "^8.4.0",
+ "eslint-visitor-keys": "^4.2.1",
+ "espree": "^10.4.0",
+ "esquery": "^1.5.0",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
+ "file-entry-cache": "^8.0.0",
"find-up": "^5.0.0",
"glob-parent": "^6.0.2",
- "globals": "^13.19.0",
- "graphemer": "^1.4.0",
"ignore": "^5.2.0",
"imurmurhash": "^0.1.4",
"is-glob": "^4.0.0",
- "is-path-inside": "^3.0.3",
- "js-yaml": "^4.1.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
"lodash.merge": "^4.6.2",
- "minimatch": "^3.1.2",
+ "minimatch": "^3.1.5",
"natural-compare": "^1.4.0",
- "optionator": "^0.9.3",
- "strip-ansi": "^6.0.1",
- "text-table": "^0.2.0"
+ "optionator": "^0.9.3"
},
"bin": {
"eslint": "bin/eslint.js"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
- "url": "https://opencollective.com/eslint"
+ "url": "https://eslint.org/donate"
+ },
+ "peerDependencies": {
+ "jiti": "*"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ }
}
},
"node_modules/eslint-plugin-header": {
@@ -5909,20 +6017,14 @@
}
},
"node_modules/eslint-plugin-unused-imports": {
- "version": "3.2.0",
- "resolved": "https://registry.npmmirror.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.2.0.tgz",
- "integrity": "sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ==",
+ "version": "4.4.1",
+ "resolved": "https://registry.npmmirror.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.4.1.tgz",
+ "integrity": "sha512-oZGYUz1X3sRMGUB+0cZyK2VcvRX5lm/vB56PgNNcU+7ficUCKm66oZWKUubXWnOuPjQ8PvmXtCViXBMONPe7tQ==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "eslint-rule-composer": "^0.3.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
"peerDependencies": {
- "@typescript-eslint/eslint-plugin": "6 - 7",
- "eslint": "8"
+ "@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0",
+ "eslint": "^10.0.0 || ^9.0.0 || ^8.0.0"
},
"peerDependenciesMeta": {
"@typescript-eslint/eslint-plugin": {
@@ -5930,20 +6032,10 @@
}
}
},
- "node_modules/eslint-rule-composer": {
- "version": "0.3.0",
- "resolved": "https://registry.npmmirror.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",
- "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=4.0.0"
- }
- },
"node_modules/eslint-scope": {
- "version": "7.2.2",
- "resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-7.2.2.tgz",
- "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
+ "version": "8.4.0",
+ "resolved": "https://registry.npmmirror.com/eslint-scope/-/eslint-scope-8.4.0.tgz",
+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
@@ -5951,7 +6043,7 @@
"estraverse": "^5.2.0"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
@@ -5970,19 +6062,45 @@
"url": "https://opencollective.com/eslint"
}
},
+ "node_modules/eslint/node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
"node_modules/espree": {
- "version": "9.6.1",
- "resolved": "https://registry.npmmirror.com/espree/-/espree-9.6.1.tgz",
- "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
+ "version": "10.4.0",
+ "resolved": "https://registry.npmmirror.com/espree/-/espree-10.4.0.tgz",
+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
- "acorn": "^8.9.0",
+ "acorn": "^8.15.0",
"acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.4.1"
+ "eslint-visitor-keys": "^4.2.1"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/espree/node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
@@ -6166,16 +6284,16 @@
"license": "MIT"
},
"node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
+ "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "flat-cache": "^3.0.4"
+ "flat-cache": "^4.0.0"
},
"engines": {
- "node": "^10.12.0 || >=12.0.0"
+ "node": ">=16.0.0"
}
},
"node_modules/file-source": {
@@ -6218,18 +6336,17 @@
}
},
"node_modules/flat-cache": {
- "version": "3.2.0",
- "resolved": "https://registry.npmmirror.com/flat-cache/-/flat-cache-3.2.0.tgz",
- "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmmirror.com/flat-cache/-/flat-cache-4.0.1.tgz",
+ "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
"dev": true,
"license": "MIT",
"dependencies": {
"flatted": "^3.2.9",
- "keyv": "^4.5.3",
- "rimraf": "^3.0.2"
+ "keyv": "^4.5.4"
},
"engines": {
- "node": "^10.12.0 || >=12.0.0"
+ "node": ">=16"
}
},
"node_modules/flatted": {
@@ -6314,13 +6431,6 @@
"url": "https://github.com/sponsors/rawify"
}
},
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "dev": true,
- "license": "ISC"
- },
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
@@ -6598,16 +6708,13 @@
}
},
"node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmmirror.com/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
+ "version": "16.5.0",
+ "resolved": "https://registry.npmmirror.com/globals/-/globals-16.5.0.tgz",
+ "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "type-fest": "^0.20.2"
- },
"engines": {
- "node": ">=8"
+ "node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -6642,13 +6749,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmmirror.com/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/hachure-fill": {
"version": "0.5.2",
"resolved": "https://registry.npmmirror.com/hachure-fill/-/hachure-fill-0.5.2.tgz",
@@ -7221,18 +7321,6 @@
"node": ">=0.8.19"
}
},
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
@@ -7610,16 +7698,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmmirror.com/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/is-plain-obj": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
@@ -9436,16 +9514,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz",
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "wrappy": "1"
- }
- },
"node_modules/optionator": {
"version": "0.9.4",
"resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.9.4.tgz",
@@ -9625,16 +9693,6 @@
"node": ">=8"
}
},
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
@@ -10716,45 +10774,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmmirror.com/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "deprecated": "Rimraf versions prior to v4 are no longer supported",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "glob": "^7.1.3"
- },
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/rimraf/node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
"node_modules/robust-predicates": {
"version": "3.0.3",
"resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.3.tgz",
@@ -11674,13 +11693,6 @@
"deprecated": "no longer maintained",
"license": "Unlicense"
},
- "node_modules/text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmmirror.com/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/thenify": {
"version": "3.3.1",
"resolved": "https://registry.npmmirror.com/thenify/-/thenify-3.3.1.tgz",
@@ -11868,19 +11880,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "license": "(MIT OR CC0-1.0)",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/typed-array-buffer": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz",
@@ -12452,13 +12451,6 @@
"node": ">=8"
}
},
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true,
- "license": "ISC"
- },
"node_modules/xlsx": {
"version": "0.18.5",
"resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz",
diff --git a/package.json b/package.json
index 39d697aa..ba1ea6a3 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "react-template",
+ "name": "monkey-ai-web",
"version": "0.1.0",
"private": true,
"type": "module",
@@ -90,18 +90,18 @@
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.21",
"esbuild": "0.21.5",
- "eslint": "8.57.0",
+ "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": "^3.2.0",
+ "eslint-plugin-unused-imports": "4.4.1",
+ "globals": "16.5.0",
"i18next-cli": "^1.10.3",
"postcss": "^8.5.3",
"prettier": "^3.0.0",
"tailwindcss": "^3",
"vite": "5.4.21"
},
- "proxy": "http://localhost:3000",
"engines": {
"node": ">=22.13.0",
"npm": ">=10"
diff --git a/scripts/check-ui-dependencies.mjs b/scripts/check-ui-dependencies.mjs
index 1b1f24f4..61e033f7 100644
--- a/scripts/check-ui-dependencies.mjs
+++ b/scripts/check-ui-dependencies.mjs
@@ -42,7 +42,7 @@ export function auditManifest(manifest, lock) {
}
export function auditSource(source, filename) {
- const linter = new Linter();
+ const linter = new Linter({ configType: 'eslintrc' });
linter.defineRule('ui-dependencies', {
create(context) {
const inspect = (node) => {
diff --git a/src/components/console/ConsoleCollection.jsx b/src/components/console/ConsoleCollection.jsx
index 11aee1a5..66b71dac 100644
--- a/src/components/console/ConsoleCollection.jsx
+++ b/src/components/console/ConsoleCollection.jsx
@@ -24,6 +24,27 @@ import { useIsMobile } from '../../hooks/common/useIsMobile';
import { ConsoleCard, ConsoleSearchBar } from './ConsolePrimitives';
import { TableTitle } from '../common/table/TableToolbar';
+export function ConsoleCollectionSearch({ children, className }) {
+ const { t } = useTranslation();
+ const isMobile = useIsMobile();
+ const [expanded, setExpanded] = useState(false);
+ return (
+ <>
+ {isMobile && (
+
+ )}
+
+ {children}
+
+ >
+ );
+}
+
export default function ConsoleCollection({
children,
statsArea,
@@ -36,27 +57,13 @@ export default function ConsoleCollection({
tableActionsOffset = false,
paginationArea,
}) {
- const { t } = useTranslation();
- const isMobile = useIsMobile();
- const [expanded, setExpanded] = useState(false);
- const showSearch = !isMobile || expanded;
return (
{statsArea && (
{statsArea}
)}
{searchArea && (
- <>
- {isMobile && (
-
- )}
-
{searchArea}
- >
+
{searchArea}
)}
{tabsArea && {tabsArea}
}
diff --git a/src/components/console/ConsolePrimitives.jsx b/src/components/console/ConsolePrimitives.jsx
index 72e8e0fb..f3d67c51 100644
--- a/src/components/console/ConsolePrimitives.jsx
+++ b/src/components/console/ConsolePrimitives.jsx
@@ -32,6 +32,8 @@ import {
} from 'antd';
import { useTranslation } from 'react-i18next';
import TableEmpty from '../common/table/TableEmpty';
+import FilterSearchButton from '../common/table/FilterSearchButton';
+import './console.css';
import {
ConsoleSearchContext,
useConsolePage,
@@ -96,38 +98,32 @@ export function ConsoleSearchBar({ children, className, formProps, ...props }) {
);
}
-export function ConsoleSearchActions({
- onReset,
- onSearch,
- loading,
- searchLabel = '搜索',
-}) {
+export function ConsoleSearchActions({ onReset, loading }) {
const { t } = useTranslation();
return (
- {onReset && }
-
+ {onReset && (
+
+ )}
+
);
}
export function ConsoleFilterGrid({ children, onReset, onSearch, loading }) {
return (
-
+
+
);
}
diff --git a/src/components/console/console.css b/src/components/console/console.css
index b4dbc690..1a668572 100644
--- a/src/components/console/console.css
+++ b/src/components/console/console.css
@@ -230,7 +230,7 @@
justify-content: flex-end;
flex: 0 0 auto;
flex-wrap: wrap;
- gap: var(--console-space-1);
+ gap: var(--console-space-1, 8px);
margin-inline-start: auto;
}
.console-filter-panel {
@@ -253,7 +253,7 @@
}
.console-filter-field > label,
.console-page .console-filter-grid .ant-form-item-label > label {
- color: var(--console-muted);
+ color: var(--console-muted, var(--ui-color-text-2));
font-size: 13px;
}
.console-filter-field > :is(.ant-input-number, .ant-picker) {
diff --git a/src/components/settings/CustomerServiceSetting.jsx b/src/components/settings/CustomerServiceSetting.jsx
index b28940d5..4f3c34e5 100644
--- a/src/components/settings/CustomerServiceSetting.jsx
+++ b/src/components/settings/CustomerServiceSetting.jsx
@@ -21,7 +21,6 @@ import {
Plus as ActionPlus,
Upload as ActionUpload,
} from '@/components/common/icons/ActionIcons';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
import React, { useState, useEffect, useCallback } from 'react';
import {
Card,
@@ -32,6 +31,7 @@ import {
Select,
Tag,
Avatar,
+ Popconfirm,
Typography,
Space,
Banner,
@@ -307,34 +307,28 @@ const CustomerServiceSetting = () => {
title: t('操作'),
dataIndex: 'action',
render: (_, record) => (
- handleToggleStatus(record),
- danger: (record.status === 1 ? 'danger' : 'primary') === 'danger',
- },
- {
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: () =>
- Modal.confirm({
- title: t('确认删除'),
- content: t('确定要删除这个客服吗?'),
- okText: t('确认'),
- cancelText: t('取消'),
- okButtonProps: { danger: true },
- onOk: () => handleDelete(record.id),
- }),
- },
- ]}
- >
+
+
-
+ handleDelete(record.id)}
+ >
+
+
+
),
},
];
diff --git a/src/components/settings/LevelPolicySetting.jsx b/src/components/settings/LevelPolicySetting.jsx
index 1fcabc01..26b03204 100644
--- a/src/components/settings/LevelPolicySetting.jsx
+++ b/src/components/settings/LevelPolicySetting.jsx
@@ -24,7 +24,6 @@ import {
ChevronDown as ActionChevronDown,
ChevronRight as ActionChevronRight,
} from '@/components/common/icons/ActionIcons';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import {
Card,
@@ -990,31 +989,7 @@ const LevelPolicySetting = () => {
title: t('操作'),
width: 260,
render: (_, r) => (
- duplicateLevel(type, r.code),
- title: t('以该等级为模板新建'),
- },
- {
- key: 'delete',
- label: t('删除'),
- disabled: deletingCode === `${type}/${r.code}`,
- danger: true,
- onClick: () =>
- Modal.confirm({
- title: t('确认删除该等级?'),
- content: t('被用户/企业/默认等级引用时会被拒绝'),
- okText: t('确认'),
- cancelText: t('取消'),
- okButtonProps: { danger: true },
- onOk: () => deleteLevel(type, r.code),
- }),
- },
- ]}
- >
+
-
+
+
+
+ deleteLevel(type, r.code)}
+ >
+
+
+
),
},
];
diff --git a/src/components/settings/TutorialVideoSetting.jsx b/src/components/settings/TutorialVideoSetting.jsx
index 1be4f83f..b7e0cff9 100644
--- a/src/components/settings/TutorialVideoSetting.jsx
+++ b/src/components/settings/TutorialVideoSetting.jsx
@@ -18,7 +18,6 @@ For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import {
@@ -28,6 +27,7 @@ import {
Modal,
Form,
Toast,
+ Popconfirm,
Switch,
Tag,
Progress,
@@ -262,29 +262,7 @@ const TutorialVideoSetting = () => {
title: t('操作'),
width: 180,
render: (_, record) => (
- handleEdit(record),
- },
- {
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: () =>
- Modal.confirm({
- title: t('确定删除这个视频吗?'),
- content: t('删除后将无法恢复'),
- okText: t('确认'),
- cancelText: t('取消'),
- okButtonProps: { danger: true },
- onOk: () => handleDelete(record.id),
- }),
- },
- ]}
- >
+
-
+
+
handleDelete(record.id)}
+ >
+
+
+
),
},
];
diff --git a/src/components/smart-router/DecisionTable.jsx b/src/components/smart-router/DecisionTable.jsx
index ff3dfafc..e5c56539 100644
--- a/src/components/smart-router/DecisionTable.jsx
+++ b/src/components/smart-router/DecisionTable.jsx
@@ -30,6 +30,7 @@ const DecisionTable = ({ mode, orgId }) => {
const { t } = useTranslation();
const [data, setData] = useState({ items: [], total: 0 });
const [page, setPage] = useState(1);
+ const [pageSize, setPageSize] = useState(20);
const [loading, setLoading] = useState(true);
const [error, setError] = useState('');
@@ -38,7 +39,10 @@ const DecisionTable = ({ mode, orgId }) => {
setError('');
try {
setData(
- (await listDecisions(mode, orgId, { p: page, page_size: 20 })) || {
+ (await listDecisions(mode, orgId, {
+ p: page,
+ page_size: pageSize,
+ })) || {
items: [],
total: 0,
},
@@ -48,7 +52,7 @@ const DecisionTable = ({ mode, orgId }) => {
} finally {
setLoading(false);
}
- }, [mode, orgId, page, t]);
+ }, [mode, orgId, page, pageSize, t]);
useEffect(() => {
load();
@@ -147,12 +151,18 @@ const DecisionTable = ({ mode, orgId }) => {
/>
}
pagination={{
- // 接口固定 page_size=20,不提供每页条数切换
current: page,
- pageSize: 20,
+ pageSize,
total: data.total || 0,
size: 'small',
- showSizeChanger: false,
+ showSizeChanger: mode === 'org',
+ onPageSizeChange:
+ mode === 'org'
+ ? (size) => {
+ setPage(1);
+ setPageSize(size);
+ }
+ : undefined,
showTotal: (total) => t('共 {{total}} 条', { total }),
onChange: setPage,
}}
diff --git a/src/components/smart-router/ProfileTable.jsx b/src/components/smart-router/ProfileTable.jsx
index 2d7ea2ac..15a1e9a6 100644
--- a/src/components/smart-router/ProfileTable.jsx
+++ b/src/components/smart-router/ProfileTable.jsx
@@ -19,8 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { Button, Empty, Modal, Space, Tag, Typography } from 'antd';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
+import { Button, Empty, Popconfirm, Space, Tag, Typography } from 'antd';
import { Table } from '@/components/ui';
import { ConsoleAlert as Alert } from '../console/ConsolePrimitives';
import { Plus } from '../common/icons/ActionIcons';
@@ -149,37 +148,7 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
fixed: 'right',
width: 180,
render: (_, r) => (
- setEditing(r),
- },
- canWrite && {
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: () =>
- Modal.confirm({
- title: t('确认删除该集合?'),
- content: t('使用该虚拟模型名的请求将返回"模型不存在"。'),
- okText: t('确认'),
- cancelText: t('取消'),
- okButtonProps: { danger: true },
- onOk: async () => {
- try {
- await deleteProfile(mode, orgId, r.id);
- showSuccess(t('已删除'));
- load();
- } catch (e) {
- if (e?.message) showError(e.message);
- }
- },
- }),
- },
- ]}
- >
+
-
+ {canWrite && (
+ <>
+
+ {
+ try {
+ await deleteProfile(mode, orgId, r.id);
+ showSuccess(t('已删除'));
+ load();
+ } catch (e) {
+ if (e?.message) showError(e.message);
+ }
+ }}
+ >
+
+
+ >
+ )}
+
),
},
];
@@ -227,7 +221,7 @@ const ProfileTable = ({ mode, orgId, canWrite = true, emptyHint }) => {
loading={loading}
columns={columns}
dataSource={list}
- pagination={false}
+ pagination={mode === 'org' ? { resetOnDataChange: true } : false}
scroll={{ x: 'max-content' }}
empty={
-
-
-
}
- placeholder={t('密钥名称 / Key 片段')}
- showClear
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
}
+ placeholder={t('密钥名称 / Key 片段')}
+ showClear
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
);
};
diff --git a/src/components/table/admin-tokens/admin-tokens.css b/src/components/table/admin-tokens/admin-tokens.css
index a9575622..55517769 100644
--- a/src/components/table/admin-tokens/admin-tokens.css
+++ b/src/components/table/admin-tokens/admin-tokens.css
@@ -1,32 +1,3 @@
-.console-page .console-search-card .admin-tokens-filter-form {
- display: block;
-}
-
-.admin-tokens-filter-grid {
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 1rem;
- width: 100%;
-}
-
-.console-page .admin-tokens-filter-grid .ant-form-item-label > label {
- color: var(--console-muted);
- font-size: 13px;
-}
-
-.admin-tokens-filter-actions,
-.admin-tokens-tools {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- flex-wrap: wrap;
- gap: 0.5rem;
-}
-
-.admin-tokens-filter-actions {
- margin-top: 1rem;
-}
-
.admin-tokens-toolbar {
display: flex;
align-items: center;
@@ -39,6 +10,11 @@
.admin-tokens-tools {
margin-inline-start: auto;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ flex-wrap: wrap;
+ gap: 8px;
}
.console-page .console-table.admin-tokens-table .ant-table-thead > tr > th {
@@ -78,15 +54,3 @@
padding: 0 4px;
font-size: 13px;
}
-
-@media (max-width: 1100px) {
- .admin-tokens-filter-grid {
- grid-template-columns: repeat(2, minmax(0, 1fr));
- }
-}
-
-@media (max-width: 768px) {
- .admin-tokens-filter-grid {
- grid-template-columns: minmax(0, 1fr);
- }
-}
diff --git a/src/components/table/channels/ChannelsColumnDefs.jsx b/src/components/table/channels/ChannelsColumnDefs.jsx
index 1a674b28..1d03871c 100644
--- a/src/components/table/channels/ChannelsColumnDefs.jsx
+++ b/src/components/table/channels/ChannelsColumnDefs.jsx
@@ -18,7 +18,6 @@ For commercial licensing, please contact support@quantumnous.com
*/
import { writeClipboardText } from '../../../helpers/clipboard';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
import React, { useState } from 'react';
import { Switch } from 'antd';
import {
@@ -730,110 +729,142 @@ export const getChannelsColumns = ({
dataIndex: 'operate',
fixed: 'right',
render: (text, record, index) => {
- if (!isRoot()) return null;
- if (record.children !== undefined) {
+ if (record.children === undefined) {
+ const moreMenuItems = [
+ {
+ node: 'item',
+ name: t('删除'),
+ type: 'danger',
+ onClick: async () => {
+ const content = await buildDeleteConfirmContent(record.id, t);
+ Modal.confirm({
+ title: t('确定是否要删除此渠道?'),
+ content,
+ onOk: () => {
+ (async () => {
+ await manageChannel(record.id, 'delete', record);
+ await refresh();
+ setTimeout(() => {
+ if (channels.length === 0 && activePage > 1) {
+ refresh(activePage - 1);
+ }
+ }, 100);
+ })();
+ },
+ });
+ },
+ },
+ {
+ node: 'item',
+ name: t('复制'),
+ type: 'tertiary',
+ onClick: () => {
+ Modal.confirm({
+ title: t('确定是否要复制此渠道?'),
+ content: t('复制渠道的所有信息'),
+ onOk: () => copySelectedChannel(record),
+ });
+ },
+ },
+ ];
+
return (
-
manageTag(record.key, 'enable'),
- },
- {
- key: 'disable',
- label: t('禁用全部'),
- onClick: () => manageTag(record.key, 'disable'),
- },
- ]}
- >
-
-
+
+ {isRoot() && (
+ <>
+
+
+
+
+
+ {record.channel_info?.is_multi_key && (
+
+ )}
+ >
+ )}
+
+ );
+ } else {
+ // 标签操作按钮
+ return (
+
+ {isRoot() && (
+ <>
+
+
+
+ >
+ )}
+
);
}
- return (
-
{
- setCurrentTestChannel(record);
- setShowModelTestModal(true);
- },
- },
- record.channel_info?.is_multi_key && {
- key: 'multi-key',
- label: t('多密钥管理'),
- onClick: () => {
- setCurrentMultiKeyChannel(record);
- setShowMultiKeyManageModal(true);
- },
- },
- {
- key: 'copy',
- label: t('复制'),
- onClick: () => {
- Modal.confirm({
- title: t('确定是否要复制此渠道?'),
- content: t('复制渠道的所有信息'),
- onOk: () => copySelectedChannel(record),
- });
- },
- },
- {
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: async () => {
- const content = await buildDeleteConfirmContent(record.id, t);
- Modal.confirm({
- title: t('确定是否要删除此渠道?'),
- content,
- onOk: () => {
- (async () => {
- await manageChannel(record.id, 'delete', record);
- await refresh();
- setTimeout(() => {
- if (channels.length === 0 && activePage > 1) {
- refresh(activePage - 1);
- }
- }, 100);
- })();
- },
- });
- },
- },
- ]}
- >
-
-
-
- );
},
},
];
diff --git a/src/components/table/models/ModelsColumnDefs.jsx b/src/components/table/models/ModelsColumnDefs.jsx
index 6cc159b7..7f858402 100644
--- a/src/components/table/models/ModelsColumnDefs.jsx
+++ b/src/components/table/models/ModelsColumnDefs.jsx
@@ -18,10 +18,9 @@ For commercial licensing, please contact support@quantumnous.com
*/
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
import React from 'react';
import { Button as AntButton, Tooltip as AntTooltip } from 'antd';
-import { Button, Tag, Modal, Tooltip } from '@/components/ui';
+import { Button, Space, Tag, Modal, Tooltip } from '@/components/ui';
import {
timestamp2string,
getLobeHubIcon,
@@ -240,57 +239,64 @@ const renderOperations = (
setDetailModel,
) => {
return (
-
- manageModel(
- record.id,
- record.status === 1 ? 'disable' : 'enable',
- record,
- ),
- },
- {
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: () => {
- Modal.confirm({
- title: t('确定是否要删除此模型?'),
- content: t('此修改将不可逆'),
- onOk: () => {
- (async () => {
- await manageModel(record.id, 'delete', record);
- await refresh();
- })();
- },
- });
- },
- },
- ]
- : []
- }
- >
+
{isRoot() && (
-
+ <>
+ {record.status === 1 ? (
+
+ ) : (
+
+ )}
+
+
+
+
+ >
)}
-
+
);
};
diff --git a/src/components/table/redemptions/RedemptionsActions.jsx b/src/components/table/redemptions/RedemptionsActions.jsx
index c8e7ca9f..0bd3a3b1 100644
--- a/src/components/table/redemptions/RedemptionsActions.jsx
+++ b/src/components/table/redemptions/RedemptionsActions.jsx
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
+import { Copy, Plus, Trash2 } from '@/components/common/icons/ActionIcons';
import { Button } from '@/components/ui';
import { isAdmin } from '../../../helpers';
@@ -39,17 +40,25 @@ const RedemptionsActions = ({
return (
-
{isAdmin() && (
-
+ }
+ onClick={batchDeleteRedemptions}
+ >
{t('清除失效兑换码')}
)}
{isAdmin() && (
-
+ }
+ onClick={handleAddRedemption}
+ >
{t('添加兑换码')}
)}
diff --git a/src/components/table/redemptions/RedemptionsColumnDefs.jsx b/src/components/table/redemptions/RedemptionsColumnDefs.jsx
index c85892eb..ed350c38 100644
--- a/src/components/table/redemptions/RedemptionsColumnDefs.jsx
+++ b/src/components/table/redemptions/RedemptionsColumnDefs.jsx
@@ -18,8 +18,8 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
-import { Tag, Button, Popover } from '@/components/ui';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
+import { Tag, Button, Space, Popover, Dropdown } from '@/components/ui';
+import { IconMore } from '@/components/ui/icons';
import {
renderQuota,
timestamp2string,
@@ -147,39 +147,43 @@ export const getRedemptionsColumns = ({
title: t('操作'),
dataIndex: 'operate',
fixed: 'right',
- width: 215,
+ width: 205,
render: (text, record) => {
- const moreMenuItems = [];
- if (isAdmin() && !isExpired(record)) {
- const unused = record.status === REDEMPTION_STATUS.UNUSED;
+ // Create dropdown menu items for more operations
+ const moreMenuItems = [
+ {
+ node: 'item',
+ name: t('删除'),
+ type: 'danger',
+ onClick: () => {
+ showDeleteRedemptionModal(record);
+ },
+ },
+ ];
+
+ if (record.status === REDEMPTION_STATUS.UNUSED && !isExpired(record)) {
moreMenuItems.push({
- key: 'toggle-status',
- label: unused ? t('禁用') : t('启用'),
- disabled: record.status === REDEMPTION_STATUS.USED,
- onClick: () =>
- manageRedemption(
- record.id,
- unused ? REDEMPTION_ACTIONS.DISABLE : REDEMPTION_ACTIONS.ENABLE,
- record,
- ),
+ node: 'item',
+ name: t('禁用'),
+ type: 'warning',
+ onClick: () => {
+ manageRedemption(record.id, REDEMPTION_ACTIONS.DISABLE, record);
+ },
});
- }
- moreMenuItems.unshift({
- key: 'copy',
- label: t('复制'),
- onClick: () => copyText(record.key),
- });
- if (isAdmin()) {
+ } else if (!isExpired(record)) {
moreMenuItems.push({
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: () => showDeleteRedemptionModal(record),
+ node: 'item',
+ name: t('启用'),
+ type: 'secondary',
+ onClick: () => {
+ manageRedemption(record.id, REDEMPTION_ACTIONS.ENABLE, record);
+ },
+ disabled: record.status === REDEMPTION_STATUS.USED,
});
}
return (
-
+
-
+
{t('查看')}
+ {
+ await copyText(record.key);
+ }}
+ >
+ {t('复制')}
+
{isAdmin() && (
- {
- setEditingRedemption(record);
- setShowEdit(true);
- }}
- disabled={record.status !== REDEMPTION_STATUS.UNUSED}
- >
- {t('编辑')}
-
+ <>
+ {
+ setEditingRedemption(record);
+ setShowEdit(true);
+ }}
+ disabled={record.status !== REDEMPTION_STATUS.UNUSED}
+ >
+ {t('编辑')}
+
+
+ } />
+
+ >
)}
-
+
);
},
},
diff --git a/src/components/table/tokens/TokensColumnDefs.jsx b/src/components/table/tokens/TokensColumnDefs.jsx
index c92ad48a..3fd51d5f 100644
--- a/src/components/table/tokens/TokensColumnDefs.jsx
+++ b/src/components/table/tokens/TokensColumnDefs.jsx
@@ -18,10 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
import {
Button,
+ Dropdown,
Space,
+ SplitButtonGroup,
Tag,
AvatarGroup,
Avatar,
@@ -39,7 +40,12 @@ import {
getModelCategories,
showError,
} from '../../../helpers';
-import { IconCopy, IconEyeOpened, IconEyeClosed } from '@/components/ui/icons';
+import {
+ IconTreeTriangleDown,
+ IconCopy,
+ IconEyeOpened,
+ IconEyeClosed,
+} from '@/components/ui/icons';
// progress color helper
const getProgressColor = (pct) => {
@@ -321,6 +327,7 @@ const renderOperations = (
const name = Object.keys(item)[0];
if (!name) continue;
chatsArray.push({
+ node: 'item',
key: i,
name,
value: item[name],
@@ -333,70 +340,87 @@ const renderOperations = (
}
return (
-
0 && {
- key: 'chat-links',
- label: t('聊天链接'),
- children: chatsArray.map((item) => ({
- key: `chat-${item.key}`,
- label: item.name,
- onClick: item.onClick,
- })),
- },
- {
- key: 'status',
- label: record.status === 1 ? t('禁用') : t('启用'),
- danger: record.status === 1,
- onClick: async () => {
- await manageToken(
- record.id,
- record.status === 1 ? 'disable' : 'enable',
- record,
- );
+
+
+ {
+ if (chatsArray.length === 0) {
+ showError(t('请联系管理员配置聊天链接'));
+ } else {
+ const first = chatsArray[0];
+ onOpenLink(first.name, first.value, record);
+ }
+ }}
+ >
+ {t('聊天')}
+
+
+ }
+ size='small'
+ >
+
+
+
+ {record.status === 1 ? (
+ {
+ await manageToken(record.id, 'disable', record);
await refresh();
- },
- },
- {
- key: 'edit',
- label: t('编辑'),
- onClick: () => {
- setEditingToken(record);
- setShowEdit(true);
- },
- },
- {
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: () =>
- Modal.confirm({
- title: t('确定是否要删除此密钥?'),
- content: t('此修改将不可逆'),
- okButtonProps: { danger: true },
- onOk: async () => {
- await manageToken(record.id, 'delete', record);
- await refresh();
- },
- }),
- },
- ]}
- >
+ }}
+ >
+ {t('禁用')}
+
+ ) : (
+ {
+ await manageToken(record.id, 'enable', record);
+ await refresh();
+ }}
+ >
+ {t('启用')}
+
+ )}
+
{
- if (chatsArray.length === 0) {
- showError(t('请联系管理员配置聊天链接'));
- } else {
- const first = chatsArray[0];
- onOpenLink(first.name, first.value, record);
- }
+ setEditingToken(record);
+ setShowEdit(true);
}}
>
- {t('聊天')}
+ {t('编辑')}
-
+
+
{
+ Modal.confirm({
+ title: t('确定是否要删除此密钥?'),
+ content: t('此修改将不可逆'),
+ onOk: () => {
+ (async () => {
+ await manageToken(record.id, 'delete', record);
+ await refresh();
+ })();
+ },
+ });
+ }}
+ >
+ {t('删除')}
+
+
);
};
diff --git a/src/components/table/usage-logs/UsageLogs.css b/src/components/table/usage-logs/UsageLogs.css
index 699aaeac..6e8f5378 100644
--- a/src/components/table/usage-logs/UsageLogs.css
+++ b/src/components/table/usage-logs/UsageLogs.css
@@ -33,6 +33,29 @@
color: var(--ui-color-primary);
}
+.usage-logs-table .ant-table-cell.usage-record-cell-use_time {
+ vertical-align: middle;
+}
+
+.usage-record-use-time {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ vertical-align: middle;
+ gap: 6px;
+ white-space: nowrap;
+}
+
+.usage-logs-table .usage-record-use-time .ant-tag {
+ margin-inline-end: 0;
+ padding: 0 6px;
+ border-radius: 6px;
+ font-size: 12px;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
+ line-height: 22px;
+}
+
.usage-logs-table-shell {
position: relative;
}
diff --git a/src/components/table/usage-logs/UsageLogsColumnDefs.jsx b/src/components/table/usage-logs/UsageLogsColumnDefs.jsx
index dec2b20e..7e96706b 100644
--- a/src/components/table/usage-logs/UsageLogsColumnDefs.jsx
+++ b/src/components/table/usage-logs/UsageLogsColumnDefs.jsx
@@ -130,93 +130,6 @@ function renderType(type, t) {
);
}
-function renderIsStream(bool, t) {
- if (bool) {
- return (
-
-
- {t('流')}
-
- );
- } else {
- return (
-
- {t('非流')}
-
- );
- }
-}
-
-function renderUseTime(type, t) {
- const time = parseInt(type);
- let colorConfig;
-
- if (time < 101) {
- colorConfig = {
- bg: 'bg-emerald-50 dark:bg-emerald-950/30',
- text: 'text-emerald-600 dark:text-emerald-400',
- border: 'border-emerald-200/50 dark:border-emerald-800/50',
- dot: 'bg-emerald-500',
- };
- } else if (time < 300) {
- colorConfig = {
- bg: 'bg-amber-50 dark:bg-amber-950/30',
- text: 'text-amber-600 dark:text-amber-400',
- border: 'border-amber-200/50 dark:border-amber-800/50',
- dot: 'bg-amber-500',
- };
- } else {
- colorConfig = {
- bg: 'bg-rose-50 dark:bg-rose-950/30',
- text: 'text-rose-600 dark:text-rose-400',
- border: 'border-rose-200/50 dark:border-rose-800/50',
- dot: 'bg-rose-500',
- };
- }
-
- return (
-
- {time}s
-
- );
-}
-
-function renderFirstUseTime(type, t) {
- let time = parseFloat(type) / 1000.0;
- time = time.toFixed(1);
- let colorConfig;
-
- if (time < 3) {
- colorConfig = {
- bg: 'bg-teal-50 dark:bg-teal-950/30',
- text: 'text-teal-600 dark:text-teal-400',
- border: 'border-teal-200/50 dark:border-teal-800/50',
- };
- } else if (time < 10) {
- colorConfig = {
- bg: 'bg-orange-50 dark:bg-orange-950/30',
- text: 'text-orange-600 dark:text-orange-400',
- border: 'border-orange-200/50 dark:border-orange-800/50',
- };
- } else {
- colorConfig = {
- bg: 'bg-red-50 dark:bg-red-950/30',
- text: 'text-red-600 dark:text-red-400',
- border: 'border-red-200/50 dark:border-red-800/50',
- };
- }
-
- return (
-
- {time}s
-
- );
-}
-
function renderModelName(record, copyText, t, isRootUser) {
let other = getLogOther(record.other);
let modelMapped =
@@ -384,7 +297,7 @@ const applyUsageRecordPresentation = (
...baseColumn,
width: RECORD_COLUMN_WIDTHS[baseColumn.key],
fixed: undefined,
- className: `usage-record-cell-${baseColumn.key}`,
+ className: baseColumn.className ?? `usage-record-cell-${baseColumn.key}`,
};
switch (column.key) {
case COLUMN_KEYS.TIME:
@@ -449,15 +362,6 @@ const applyUsageRecordPresentation = (
) : null,
};
- case COLUMN_KEYS.USE_TIME:
- return {
- ...column,
- title: t('用时/首字').replace('/', ' / '),
- render: (text, record) =>
- record.type === 2 || record.type === 5
- ? renderRecordUseTime(record, t)
- : null,
- };
case COLUMN_KEYS.PROMPT:
case COLUMN_KEYS.COMPLETION:
return {
@@ -693,34 +597,14 @@ export const getLogsColumns = ({
},
{
key: COLUMN_KEYS.USE_TIME,
- title: t('用时/首字'),
+ title: t('用时/首字').replace('/', ' / '),
dataIndex: 'use_time',
- render: (text, record, index) => {
- if (!(record.type === 2 || record.type === 5)) {
- return <>>;
- }
- if (record.is_stream) {
- let other = getLogOther(record.other);
- return (
- <>
-
- {renderUseTime(text, t)}
- {renderFirstUseTime(other?.frt, t)}
- {renderIsStream(record.is_stream, t)}
-
- >
- );
- } else {
- return (
- <>
-
- {renderUseTime(text, t)}
- {renderIsStream(record.is_stream, t)}
-
- >
- );
- }
- },
+ align: 'center',
+ className: 'usage-record-cell-use_time',
+ render: (_, record) =>
+ record.type === 2 || record.type === 5
+ ? renderRecordUseTime(record, t)
+ : null,
},
{
key: COLUMN_KEYS.PROMPT,
diff --git a/src/components/table/usage-logs/UsageLogsTable.jsx b/src/components/table/usage-logs/UsageLogsTable.jsx
index a4dfbc2e..6ebb31f6 100644
--- a/src/components/table/usage-logs/UsageLogsTable.jsx
+++ b/src/components/table/usage-logs/UsageLogsTable.jsx
@@ -435,7 +435,7 @@ const LogsTable = (logsData) => {
if (canView) setDetailRecord(record);
}}
>
- {t('查看')}
+ {t('详情')}
);
}
@@ -449,7 +449,7 @@ const LogsTable = (logsData) => {
if (canView) setDetailRecord(record);
}}
>
- {t('查看')}
+ {t('详情')}
);
},
diff --git a/src/components/ui/index.jsx b/src/components/ui/index.jsx
index 5a16db55..ca4a3d44 100644
--- a/src/components/ui/index.jsx
+++ b/src/components/ui/index.jsx
@@ -288,6 +288,7 @@ export function Table({
expandedRowKeys,
onExpand,
expandRowByClick,
+ expandable: nativeExpandable,
pagination,
size,
onChange,
@@ -305,7 +306,7 @@ export function Table({
onExpand,
expandRowByClick,
}
- : undefined;
+ : nativeExpandable;
return (
{
+ if (resetLocalPage) setLocalPage(1);
+ }, [resetLocalPage, resetSource]);
const pageSize =
local && !config.onPageSizeChange ? localSize : (config.pageSize ?? 10);
const total = config.total ?? props.dataSource?.length ?? 0;
diff --git a/src/components/ui/pagination.js b/src/components/ui/pagination.js
index 16aed87d..4060f385 100644
--- a/src/components/ui/pagination.js
+++ b/src/components/ui/pagination.js
@@ -21,7 +21,9 @@ import i18next from 'i18next';
export const isCenterPaginationScope = () =>
typeof window !== 'undefined' &&
- /^\/(console|org)(\/|$)/.test(window.location?.pathname || '');
+ /^\/(?:console|org|user-center\/key-management)(?:\/|$)/.test(
+ window.location?.pathname || '',
+ );
export const centerPaginationOptions = (config, isMobile = false) => ({
...config,
diff --git a/src/pages/AdminInvoice/index.jsx b/src/pages/AdminInvoice/index.jsx
index 82b49429..605ce9a0 100644
--- a/src/pages/AdminInvoice/index.jsx
+++ b/src/pages/AdminInvoice/index.jsx
@@ -25,7 +25,6 @@ import {
ConsoleListTable,
} from '../../components/console/ConsolePrimitives';
import ConsoleCollection from '../../components/console/ConsoleCollection';
-import { TableRowActions } from '../../components/common/table/TableToolbar';
import { useIsMobile } from '../../hooks/common/useIsMobile';
import { createCardProPagination } from '../../helpers/utils';
import React, { useEffect, useState, useCallback } from 'react';
@@ -40,7 +39,14 @@ import {
Spin,
Typography,
} from '@/components/ui';
-import { Search } from 'lucide-react';
+import {
+ Search,
+ Eye as ActionEye,
+ Check as ActionCheck,
+ X as ActionX,
+ Ban as ActionBan,
+ RotateCw as ActionRotateCw,
+} from '@/components/common/icons/ActionIcons';
import { API, showError, showSuccess } from '../../helpers';
import {
INVOICE_STATUS,
@@ -307,53 +313,78 @@ const AdminInvoice = () => {
{
title: t('操作'),
key: 'actions',
- width: 140,
+ width: 200,
fixed: 'right',
render: (_, record) => (
- {
- setApproveId(record.id);
- setApproveVisible(true);
- },
- },
- record.status === INVOICE_STATUS.PENDING && {
- key: 'reject',
- label: t('拒绝'),
- danger: true,
- onClick: () => {
- setRejectId(record.id);
- setRejectVisible(true);
- },
- },
- record.status === INVOICE_STATUS.FAILED && {
- key: 'retry',
- label: t('重试'),
- onClick: () => handleRetry(record.id),
- },
- [
- INVOICE_STATUS.APPROVED,
- INVOICE_STATUS.INVOICING,
- INVOICE_STATUS.FAILED,
- ].includes(record.status) && {
- key: 'cancel',
- label: t('取消'),
- danger: true,
- onClick: () => handleFailCancel(record.id),
- },
- ]}
- >
+
}
onClick={() => handleViewDetail(record.id)}
- >
- {t('详情')}
-
-
+ />
+ {record.status === INVOICE_STATUS.PENDING && (
+ <>
+ }
+ onClick={() => {
+ setApproveId(record.id);
+ setApproveVisible(true);
+ }}
+ >
+ {t('通过')}
+
+ }
+ onClick={() => {
+ setRejectId(record.id);
+ setRejectVisible(true);
+ }}
+ >
+ {t('拒绝')}
+
+ >
+ )}
+ {(record.status === INVOICE_STATUS.APPROVED ||
+ record.status === INVOICE_STATUS.INVOICING) && (
+ }
+ onClick={() => handleFailCancel(record.id)}
+ >
+ {t('取消')}
+
+ )}
+ {record.status === INVOICE_STATUS.FAILED && (
+ <>
+ }
+ onClick={() => handleRetry(record.id)}
+ >
+ {t('重试')}
+
+ }
+ onClick={() => handleFailCancel(record.id)}
+ >
+ {t('取消')}
+
+ >
+ )}
+
),
},
];
@@ -374,7 +405,6 @@ const AdminInvoice = () => {
placeholder={t('搜索抬头/税号/订单号/用户')}
value={keyword}
onChange={setKeyword}
- onEnterPress={handleSearch}
/>
@@ -576,10 +606,10 @@ const AdminInvoice = () => {
}}
/>
- .
For commercial licensing, please contact support@quantumnous.com
*/
-import { TableRowActions } from '@/components/common/table/TableToolbar';
import {
ExternalLink as ActionExternalLink,
BarChart3 as ActionBarChart3,
@@ -854,70 +853,96 @@ const AdminOrganizations = () => {
{
title: t('操作'),
key: 'actions',
- width: 140,
+ width: 380,
fixed: 'right',
- render: (_, record) =>
- isAdmin() ? (
- {
+ render: (_, record) => (
+
+ {isAdmin() && (
+ <>
+ openEditModal(record)}
+ >
+ {t('编辑')}
+
+ {
setQuotaOrgId(record.id);
setQuotaAmount(0);
setQuotaModalVisible(true);
- },
- },
- {
- key: 'features',
- label: t('功能开关'),
- onClick: () => openFeatureModal(record),
- },
- {
- key: 'status',
- label:
- record.status === 4
- ? t('激活')
- : record.status === 1
- ? t('冻结')
- : t('解冻'),
- onClick: () =>
- record.status === 4
- ? handleActivate(record.id)
- : handleStatusChange(
- record.id,
- record.status === 1 ? 2 : 1,
- ),
- },
- isRoot() && {
- key: 'notifications',
- disabled: alertToggleLoading === record.id,
- label: alertExcludedIds.has(record.id)
- ? t('恢复通知')
- : t('屏蔽通知'),
- title: alertExcludedIds.has(record.id)
- ? t('已屏蔽预警,点击恢复')
- : t('屏蔽该企业的预警通知'),
- onClick: () => toggleAlertExclude(record),
- },
- {
- key: 'delete',
- label: t('删除'),
- danger: true,
- onClick: () => handleDelete(record.id),
- },
- ]}
- >
- openEditModal(record)}
- >
- {t('编辑')}
-
-
- ) : null,
+ }}
+ >
+ {t('调额')}
+
+ openFeatureModal(record)}
+ >
+ {t('功能开关')}
+
+ {record.status === 4 ? (
+ handleActivate(record.id)}
+ >
+ {t('激活')}
+
+ ) : record.status === 1 ? (
+ handleStatusChange(record.id, 2)}
+ >
+ {t('冻结')}
+
+ ) : (
+ handleStatusChange(record.id, 1)}
+ >
+ {t('解冻')}
+
+ )}
+ handleDelete(record.id)}
+ >
+ {t('删除')}
+
+ {isRoot() && (
+ toggleAlertExclude(record)}
+ >
+ {alertExcludedIds.has(record.id)
+ ? t('恢复通知')
+ : t('屏蔽通知')}
+
+ )}
+ >
+ )}
+
+ ),
},
];
diff --git a/src/pages/CommissionV2/LatestTierPanel.jsx b/src/pages/CommissionV2/LatestTierPanel.jsx
index c05dc098..cd9c9a5c 100644
--- a/src/pages/CommissionV2/LatestTierPanel.jsx
+++ b/src/pages/CommissionV2/LatestTierPanel.jsx
@@ -33,6 +33,7 @@ export default function LatestTierPanel({
columns,
onExport,
refreshToken,
+ toolbarActions,
}) {
const { t } = useTranslation();
const generation = useRef(0);
@@ -42,7 +43,7 @@ export default function LatestTierPanel({
const activeContext = useRef(context);
activeContext.current = context;
const exportRequest = useRef(null);
- const [query, setQuery] = useState({ status: 'all', page: 1 });
+ const [query, setQuery] = useState({ status: 'all', page: 1, pageSize: 10 });
const [state, setState] = useState({
items: [],
total: 0,
@@ -142,16 +143,21 @@ export default function LatestTierPanel({
partners={[]}
searchableText={() => ''}
onExport={exportAll}
+ toolbarActions={toolbarActions}
server={{
...visible,
page: query.page,
+ pageSize: query.pageSize,
exporting,
onChange: (next) => {
generation.current++;
exportRequest.current = null;
setExporting(false);
setState((old) => ({ ...old, items: [], busy: true, error: '' }));
- setQuery(next);
+ setQuery((current) => ({
+ ...next,
+ pageSize: next.pageSize ?? current.pageSize,
+ }));
},
}}
/>
diff --git a/src/pages/CommissionV2/ListPanel.jsx b/src/pages/CommissionV2/ListPanel.jsx
index aa6e4ab6..59556a7f 100644
--- a/src/pages/CommissionV2/ListPanel.jsx
+++ b/src/pages/CommissionV2/ListPanel.jsx
@@ -21,13 +21,13 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Button, Empty, Input, Select } from 'antd';
import { Table } from '@/components/ui';
-import { Search } from '@/components/common/icons/ActionIcons';
+import { Download, Search } from '@/components/common/icons/ActionIcons';
import {
ConsoleCard,
- ConsoleSearchBar,
- ConsoleSearchActions,
+ ConsoleFilterGrid,
ConsoleTabs,
} from '../../components/console/ConsolePrimitives';
+import { ConsoleCollectionSearch } from '../../components/console/ConsoleCollection';
import { filterCommissionRows, matchesStatus } from './listFilters';
export default function ListPanel({
@@ -37,6 +37,7 @@ export default function ListPanel({
partners,
searchableText,
onExport,
+ toolbarActions,
context,
server,
}) {
@@ -46,6 +47,7 @@ export default function ListPanel({
const [scopedIds, setScopedIds] = useState(context?.ids || null);
const [status, setStatus] = useState('all');
const [page, setPage] = useState(1);
+ const [pageSize, setPageSize] = useState(10);
const set = (key, value) =>
setDraft((current) => ({ ...current, [key]: value }));
const tabSets = {
@@ -130,7 +132,6 @@ export default function ListPanel({
setScopedIds(null);
setPage(1);
};
- const [filtersOpen, setFiltersOpen] = useState(false);
return (
{tabSets[section] && (
@@ -175,124 +176,107 @@ export default function ListPanel({
)}
- setFiltersOpen((value) => !value)}
- >
- {t(filtersOpen ? '隐藏操作项' : '显示操作项')}
-
-
-
-
+ }),
+ )}
+ />
+
+ )}
+ {['assignments', 'bills', 'adjustments'].includes(section) && (
+
+ )}
+
+
-
+
{t('共 {{count}} 条', {
count: server ? server.total : filtered.length,
})}
- {onExport && (
-
onExport(filtered)}
- >
- {t('导出')}
-
- )}
+
+ {onExport && (
+ }
+ loading={server?.exporting}
+ disabled={!!server?.busy}
+ onClick={() => onExport(filtered)}
+ >
+ {t('导出')}
+
+ )}
+ {toolbarActions}
+
{
- setPage(next);
- server?.onChange({ ...filters, status, page: next });
- },
- showSizeChanger: false,
- showTotal: (total) => t('共 {{total}} 条', { total }),
- }}
+ pagination={
+ (server ? server.total : filtered.length)
+ ? {
+ size: 'small',
+ pageSize: server ? server.pageSize : pageSize,
+ total: server ? server.total : filtered.length,
+ currentPage: server ? server.page : page,
+ onPageChange: (next) => {
+ setPage(next);
+ server?.onChange({ ...filters, status, page: next });
+ },
+ onPageSizeChange: (nextSize) => {
+ setPage(1);
+ setPageSize(nextSize);
+ server?.onChange({
+ ...filters,
+ status,
+ page: 1,
+ pageSize: nextSize,
+ });
+ },
+ }
+ : false
+ }
empty={
item.partner_id === row.id,
)}
- pagination={{ pageSize: 5, size: 'small' }}
+ pagination={{ pageSize: 10 }}
columns={[
{
title: t('客户'),
diff --git a/src/pages/CommissionV2/PartnerPortal.jsx b/src/pages/CommissionV2/PartnerPortal.jsx
index 4383443f..3f95c5ae 100644
--- a/src/pages/CommissionV2/PartnerPortal.jsx
+++ b/src/pages/CommissionV2/PartnerPortal.jsx
@@ -18,7 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
*/
import { formatIdReference } from '../../helpers/safeDisplay';
-import { TableRowActions } from '@/components/common/table/TableToolbar';
+import { ConsoleCollectionSearch } from '@/components/console/ConsoleCollection';
+import {
+ ConsoleFilterField,
+ ConsoleFilterGrid,
+} from '@/components/console/ConsolePrimitives';
import React, {
useCallback,
useEffect,
@@ -44,6 +48,8 @@ import {
} from '@/components/ui';
import {
ArrowLeft as ActionArrowLeft,
+ Download,
+ Search,
RefreshCw as ActionRefresh,
} from '@/components/common/icons/ActionIcons';
import {
@@ -148,6 +154,9 @@ export default function PartnerPortal({
const [customerStatus, setCustomerStatus] = useState('all');
const [billMonth, setBillMonth] = useState('all');
const [billStatus, setBillStatus] = useState('all');
+ const [billPage, setBillPage] = useState(1);
+ const [customerPage, setCustomerPage] = useState(1);
+ const [detailPage, setDetailPage] = useState(1);
const loadVersion = useRef(0);
const detailVersion = useRef(0);
const selectedId = useRef(null);
@@ -252,6 +261,7 @@ export default function PartnerPortal({
setDetailLoading(true);
setError('');
setQuery('');
+ setDetailPage(1);
setAction(null);
setReason('');
setActionError('');
@@ -496,25 +506,9 @@ export default function PartnerPortal({
},
{
title: t('操作'),
- width: 175,
+ width: 230,
render: (_, row) => (
- exportStatement(row),
- },
- row.status === 'pending_confirmation' && {
- key: 'reject',
- label: t('驳回'),
- danger: true,
- disabled: mutationLoading,
- onClick: () => open(row, 'reject'),
- },
- ]}
- >
+
{row.status === 'pending_confirmation' && (
- open(row, 'confirm')}
- >
- {t('确认')}
-
+ <>
+ open(row, 'confirm')}
+ >
+ {t('确认')}
+
+ open(row, 'reject')}
+ >
+ {t('驳回')}
+
+ >
)}
-
+ exportStatement(row)}
+ >
+ {t('导出')}
+
+
),
},
];
+ const refreshButton = (
+ }
+ disabled={mutationLoading || detailLoading}
+ loading={loading}
+ onClick={() => {
+ load();
+ if (selected) open(selected);
+ }}
+ >
+ {t('刷新')}
+
+ );
+
const renderBills = () => (
<>
+
+ {
+ setBillMonth('all');
+ setBillStatus('all');
+ setBillPage(1);
+ }}
+ onSearch={() => setBillPage(1)}
+ >
+
+
+
+
+
+
-
-