Commit Graph

277 Commits

Author SHA1 Message Date
chengkai3 6cd959c528 refactor: use backend API for user ID uniqueness validation
- Add GET /api/v1/users/check-id/{user_id} endpoint for real-time validation
- Replace frontend local validation with debounced API calls (500ms)
- Support exclude_user_id parameter for edit scenarios
- Add UserIdCheckResponse schema
- Maintain format validation (alphanumeric + underscore) on frontend
- Clean up timeout on component unmount

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 11:04:39 +08:00
chengkai3 46fb766861 [feat]:[FL-12][用户管理页面卡片视图优化2]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 11:02:13 +08:00
chengkai3 a5315c92d6 feat:[FL-11][用户管理页面卡片视图优化]
- 卡片视图支持点击卡片直接进入编辑模式
- 移除卡片底部的编辑、删除按钮
- 保留右上角更多操作菜单(分配角色、禁用/启用、重置密码)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:56:21 +08:00
chengkai3 64b6409725 [fix]:[FL-10][用户管理页面卡片视图时,角色放在邮箱上面]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:52:32 +08:00
chengkai3 bfb3ad9cb8 feat:[FL-9][用户管理页面的角色信息展示中文]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:51:26 +08:00
chengkai3 3789411570 fix:[FL-8][用户管理页面操作列宽度调整为180px]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:49:19 +08:00
chengkai3 65de32d7f3 feat: 用户管理页面增加角色列展示
在用户列表中增加"角色"列,显示在用户名和邮箱之间。
用户角色使用蓝色标签样式展示,支持多个角色同时显示。
同时在移动端卡片视图中也增加了角色展示。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:35:09 +08:00
chengkai3 ee1c534a2d feat: improve user ID validation in user management page
- Add real-time validation for user ID format (letters, numbers, underscore only)
- Add real-time uniqueness check during input (not just on submit)
- Apply validation to both create and edit user modals
- Show inline error messages immediately when validation fails

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:33:00 +08:00
chengkai3 9424abaa64 移除用户管理页面编辑用户时的状态表单字段
从编辑用户模态框中移除状态选择器,用户状态现在只能通过操作菜单中的"启用/禁用"选项来修改。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:32:21 +08:00
chengkai3 b646f16e85 添加角色分配表单必填校验
- 角色字段标记为必填,显示红色星号
- 点击保存按钮时立即触发校验
- 未选择角色时显示错误提示「请至少选择一个角色」
- 校验失败时不会关闭模态框

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:30:37 +08:00
Admin 68a865adb9 [fix]:[FL-208][用户管理页面卡片视图优化]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-19 10:02:43 +08:00
chengkai3 04d67c3d3d feat: [FL-201] 参考用户管理页面逻辑给菜单管理页面增加卡片视图
- 新增 useMobileDetection hook 引入
- 新增 Dropdown、Typography 和 MoreOutlined 等 UI 组件引入
- 添加 viewMode 状态管理(table/card 切换)
- 新增 renderMenuCard 函数,实现菜单项卡片视图渲染
- 卡片视图支持显示菜单编码、路径、父菜单、排序等信息
- 卡片视图包含编辑和删除操作按钮
- 根据 viewMode 在表格和卡片视图之间切换显示
- 卡片视图使用响应式布局(Row/Col)适配不同屏幕
- 移动端自动切换为卡片视图

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 13:49:59 +08:00
chengkai3 c6aed6c139 feat:[FL-200][参考用户管理页面逻辑给角色管理页面增加卡片视图]
- 引入 useMobileDetection hook 实现移动端自动切换视图
- 添加 viewMode 状态管理表格和卡片视图切换
- 实现 renderRoleCard 函数展示角色卡片
- 卡片视图显示角色名称、编码和绑定菜单信息
- 支持编辑和删除操作按钮
- 移动端默认使用卡片视图,桌面端默认使用表格视图

Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 13:34:11 +08:00
chengkai3 83e1508b2f fix:[FL-196][去掉用户管理页面的视图切换按钮]
- 移除视图切换按钮组件
- 保留根据设备类型自动切换视图的逻辑(浏览器用表格,手机用卡片)
- 清理未使用的图标导入(AppstoreOutlined, TableOutlined)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 13:07:09 +08:00
chengkai3 172e124d4d feat:[FL-194][用户管理页面的视图开关优化]
将视图切换按钮从卡片标题区移至搜索栏右侧,移除按钮文字仅保留图标,优化页面布局。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 12:04:29 +08:00
chengkai3 a332ba58ba [fix]:[FL-190][系统接口中的stacktrace信息不要直接展示到页面给用户看]
- 后端:在 exception_handlers.py 添加文档注释,明确说明 stacktrace 字段仅供开发调试使用
- 前端:在 api.ts 添加 ApiErrorResponse 类型定义和文档注释,明确 readApiError 函数只提取 detail 字段展示给用户
- stacktrace 在 debug 模式下会返回给浏览器(可在开发者工具中查看),但前端不会展示到页面上

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 10:19:25 +08:00
chengkai3 33db320c0e feat:[FL-189][给用户管理增加卡片视图]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 10:10:01 +08:00
chengkai3 5796797120 fix:[FL-188][菜单管理页面关键字过滤后查不到数据时分页组件不要隐藏]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 10:04:18 +08:00
chengkai3 af14490042 fix: [FL-186][菜单管理页面输入关键字时不要触发查询动作]
将关键字输入与实际查询参数分离,用户在输入框中输入时不会立即触发API请求。
只有在点击「搜索」按钮或按下Enter键时才执行查询。

改动点:
- 新增activeKeyword和activeStatusFilter状态用于存储实际查询参数
- 修改loadMenus依赖为activeKeyword和activeStatusFilter
- 新增handleSearch函数,在点击搜索时更新查询参数
- 为关键字输入框添加onPressEnter支持

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:41:13 +08:00
chengkai3 e47fd7e855 fix:[FL-183][菜单管理页面优化]
- 移除排序方式过滤表单和重置筛选按钮
- 新增主题色搜索按钮,查询需手动触发
- 修复表单值变化触发两次查询的问题
- 输入关键字时不再自动触发查询

Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:25:51 +08:00
chengkai3 4a97c4f80c fix:[FL-182][菜单列表改名菜单管理]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:20:33 +08:00
chengkai3 5f10af0b30 fix:[FL-181][用户管理页面去掉操作列固定]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:07:22 +08:00
chengkai3 cb1c883ce7 feat:[FL-179][角色管理页面所有角色都要支持删除]
移除了对admin和user角色的删除限制,现在所有角色都可以删除。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:06:44 +08:00
chengkai3 aecf0ca396 fix: [FL-178][缩小角色管理页面表格列宽度]
- 角色编码列宽从180px缩小到140px
- 角色名称列宽从180px缩小到140px
- 菜单列最大宽度从420px缩小到300px
- 操作列宽从160px缩小到140px
- 移除表格横向滚动配置(x: 1400),使表格自适应容器宽度

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:06:19 +08:00
chengkai3 b1f3785f77 fix:[FL-180][角色管理页面新增编辑表单宽度调整]
移除角色管理页面 Modal 的 width={760} 属性,使其使用默认宽度,与用户管理页面保持一致

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:05:51 +08:00
chengkai3 84e74fda3f fix:[FL-177][去掉主题中的紧凑主题]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:35:03 +08:00
chengkai3 6519fee729 [feat]:[FL-172][用户管理页面新增用户时邮箱放最后,且不要必填]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:34:20 +08:00
chengkai3 e37ecac9af fix:[FL-175][角色管理页面搜索无结果时显示分页组件]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:30:46 +08:00
chengkai3 31d65094b1 fix:[FL-176][用户管理页面用户列表改成用户管理]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:29:02 +08:00
chengkai3 db843dc31a [fix]:[FL-171][角色管理页面角色编码不要用标签展示]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:27:11 +08:00
chengkai3 c54b0faceb [fix]:[FL-173][系统右上角点击用户头像展开下来信息时,不要展示状态信息]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:26:55 +08:00
chengkai3 67a895fe01 [fix]:[FL-170][角色管理页面输入关键字时不要直接触发查询]
将角色管理页面的搜索行为从输入时自动触发改为手动触发(点击搜索按钮或按回车键)。

主要改动:
- 修改 loadData 函数接收可选的 keyword 参数,不再依赖 searchKeyword 状态
- 移除 searchKeyword 从 loadData 的依赖数组,避免每次输入都触发请求
- 更新搜索按钮和回车事件处理,显式传入 searchKeyword 参数

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:25:36 +08:00
chengkai3 4d8cfa4b02 [fix]:[FL-169][用户管理页面loading位置调整]
将用户管理页面查询时的loading从新增用户按钮左边移到表格上方,
与角色管理页面保持一致。移除Card extra中的Spin组件,loading
完全由Table组件的loading属性控制。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:23:28 +08:00
chengkai3 cdc0b4b054 feat:[FL-165][角色管理页面查询时合并角色和菜单请求]
将角色管理页面的角色和菜单两个独立API请求合并为单个请求,减少网络开销。

后端改动:
- 新增 RolesWithMenusResponse 响应模型
- 新增 list_roles_with_menus 服务函数
- 新增 GET /api/v1/admin/roles-with-menus 接口

前端改动:
- 更新 loadData 函数使用新的合并接口
- 减少从两个并发请求改为单个请求

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:05:11 +08:00
chengkai3 22f3bdd438 fix:[FL-164][角色列表标题改成角色管理]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 00:00:24 +08:00
chengkai3 1ef379304c feat:[FL-166][角色管理新建编辑角色表单单列展示]
将角色管理表单中的"角色编码"和"角色名称"从双列布局改为单列展示,提升表单可读性。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:53:08 +08:00
chengkai3 6535863691 [fix]:[FL-162][优化用户管理页面表格宽度,移除横向滚动条]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:51:01 +08:00
chengkai3 5835de1601 feat:[FL-163][角色管理页面去掉重置筛选按钮,搜索按钮用主题色]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:48:40 +08:00
chengkai3 864fd5e239 fix:[FL-161][用户管理页面操作列宽度固定在120px]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:48:10 +08:00
chengkai3 dd15768623 feat:[FL-160][角色管理页面表单过滤改成后台查询]
- 后端API新增keyword查询参数支持角色搜索
- 在数据库层面实现基础过滤优化性能
- 前端移除客户端过滤逻辑改为调用后端API
- 添加搜索按钮和回车搜索功能

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:23:38 +08:00
chengkai3 1384c0c449 fix:[FL-157][新建用户表单改为单列展示]
- 移除新建用户表单的grid双列布局
- 表单字段现在以单列形式垂直排列展示

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:14:14 +08:00
chengkai3 371d1fdfe1 fix:[FL-159][登录后跳转到菜单数据中的第一个菜单]
- 修改登录后的重定向逻辑,从硬编码的 /users 改为动态获取用户菜单数据的第一个菜单路径
- 新增 findFirstMenuPath 函数递归查找第一个有效菜单路径
- 新增 normalizeMenuTreePaths 函数标准化菜单路径
- 在 useEffect 中调用 /api/v1/admin/me/menus 接口获取菜单数据
- 如果菜单获取失败或没有有效路径,仍回退到 /users 作为默认页面

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:12:37 +08:00
chengkai3 22e316850e fix:[FL-157][移除用户ID列的标签样式]
- 移除用户ID列的Typography.Text code渲染
- 用户ID现在以普通文本形式显示

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:06:24 +08:00
chengkai3 1c1843e180 fix:[FL-157][修复搜索无结果时操作列宽度变宽问题]
- 添加tableLayout="fixed"属性强制固定表格布局
- 确保即使数据为空时,操作列宽度也保持180px不变

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 23:02:19 +08:00
chengkai3 9d6bd733a2 fix:[FL-157][搜索无结果时保持分页组件显示]
- 设置分页total最小值为1,确保即使数据为0时分页组件也显示
- showTotal显示真实的数据条数,不受最小值影响

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 22:59:26 +08:00
chengkai3 cf5bbc3548 fix: [FL-158] 去掉登录页面的立即注册
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 22:46:19 +08:00
chengkai3 c64a0584f3 fix:[FL-157][去掉编辑用户状态字段必填校验]
- 移除状态字段的required校验规则
- 允许编辑用户时状态为可选项

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 22:43:44 +08:00
chengkai3 9f869284d2 feat:[FL-157][编辑用户表单增强]
- 编辑用户时添加用户ID字段并可编辑
- 调整表单字段顺序:用户ID、用户名、邮箱、状态
- 邮箱改为非必填项
- 用户ID添加唯一性校验,防止与已有用户冲突
- 更新API payload支持new_user_id字段

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 22:31:14 +08:00
chengkai3 6cb8cf8cba fix:[FL-157][状态过滤清空时不显示all]
- 修改statusFilter类型为可选值,去除all类型
- 清空时保持undefined状态,不回退到all
- 添加placeholder显示全部提示
- 调整查询逻辑仅在statusFilter有值时添加status参数

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 22:01:46 +08:00
chengkai3 fcff08afce fix:[FL-150][给ant-card增加height:100%确保占满父容器]
在所有管理页面的AntCard/Card组件上添加style={{ height: '100%' }},
确保卡片占满父容器的高度,解决页面底部padding看起来比顶部多的问题。

修改文件:
- web/src/app/admin/users/page.tsx
- web/src/app/admin/menus/page.tsx
- web/src/app/admin/system-params/page.tsx
- web/src/app/admin/task-monitor/page.tsx
- web/src/app/admin/syslog/page.tsx
- web/src/app/admin/workers/page.tsx
- web/src/app/admin/atp-models/page.tsx
- web/src/app/admin/roles/page.tsx
- web/src/app/admin/scheduled-tasks/page.tsx
- web/src/app/admin/elevation/page.tsx
- web/src/app/admin/system-messages/page.tsx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 21:29:15 +08:00