12ca018ead
feat: KnowledgeSources 页面增加文件存在性校验列
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
2026-07-04 12:15:05 +08:00
64da1b1c0e
fix: servers API path
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
2026-07-04 12:00:37 +08:00
d6b1df061d
docs: README 全面更新 — 环境变量 + 部署 + 认证 + 开发规范
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
- 更新项目结构(反映 18 个 types 文件、33 个 API 模块、Zustand 等)
- 添加环境变量说明
- 添加认证架构(httpOnly cookie 流程)
- 添加部署文档(CI/CD + 服务器架构 + 手动部署)
- 添加开发规范(状态管理、错误处理、TypeScript)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-04 11:29:37 +08:00
176593a8c2
feat: Token 安全升级 — localStorage 迁移至 httpOnly cookie
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 12s
- api-client: withCredentials: true,移除 Authorization header 注入
- api-client: 401 刷新改为 cookie 模式,无需前端传 refreshToken
- token.ts: 废弃 localStorage token 读写,保留 admin user 缓存
- use-auth-query: 移除 setTokens/clearTokens 调用
- auth.ts: logout 不再传 refreshToken(cookie 标识会话)
Breaking: 需要后端同步部署(登录/刷新 Set-Cookie + 守卫读 cookie)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-04 11:18:02 +08:00
832a7f7960
feat: 统一错误处理体系 — ErrorBoundary + toastError
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
- 新建 ErrorBoundary 组件,捕获渲染崩溃,避免白屏
- 新建 error-handler.ts,统一错误格式化 + toast 提示
- App.tsx: ErrorBoundary 包裹路由 + QueryClient mutation onError
- TaskAssistant.tsx: 修复 5 处空 catch {} 吞错
- ReportingAdmin / VectorAdmin: 替换空 catch
- antd-global.ts: 自动注册 message 到 error-handler
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-04 11:09:29 +08:00
91698a2f3b
refactor: TypeScript 类型体系重构 + 状态管理 + 环境配置
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
## 类型安全
- tsconfig: 开启 strict: true(豁免 noImplicitAny + strictNullChecks,待后续收紧)
- 新建 15 个领域类型文件 (src/types/),共 ~80 个类型定义
- 统一 barrel export (src/types/index.ts)
- 消除 9 个 [key: string]: any 接口
- 消除 22 个 API data: any 参数 → 替换为具体 DTO
- 消除 36 个 Promise<any> → 使用具体泛型
- 消除重复 PaginatedResponse,统一使用 PaginatedResult
- API 内联类型全部迁至 types/
## 状态管理
- 引入 Zustand (zustand + persist)
- 新建 src/stores/ui-store.ts — 侧边栏折叠状态持久化
- AdminLayout 接入 useUIStore
## 环境配置
- 新建 .env.example — 环境变量模板
- 新建 .env.production — 生产架构文档
- 新建 src/vite-env.d.ts — IDE 类型声明
## 通用 UI 类型
- 新建 src/types/ui.ts — TypedColumn<T>, SortState, FilterState 等
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-04 11:02:52 +08:00
f291f39049
fix: 修复 CI 构建 49 个 TypeScript 错误
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 10s
- routes/index.tsx: DataPages → 独立文件 import
- 导出 CostItem、CostSummary、Conversation、HealthService 类型
- ServerInfo、ProcessInfo、ServerHealth 类型补全嵌套字段
- 修复 useRef 缺初始值、string|null、unused imports 等
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-01 22:50:22 +08:00
8663ceba66
feat: HTTP 层重构 + API 抽离 + 状态管理优化 + 路由修复
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 10s
- HTTP 层:安装 axios,创建 lib/api-client.ts 统一拦截器
- API 层:创建 33 个 api/*.ts 文件,所有页面迁移完成
- DataPages.tsx 拆分为 10 个独立文件
- message 导入统一为 App.useApp()
- 新增 StaticAntdProvider 全局消息/通知
- 全局 HTTP 错误/成功提示(notification.error/success)
- learning 路由 /learning → /learning/dashboard 修复选中 bug
- 学习会话页面优化(移除 ID 列、加批量删除、后端排序)
- 文档导入页面重构(知识库筛选、批量重新解析)
- 删除旧 service 文件 10 个(admin-api、billing-api 等)
- antd App 包裹根组件
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-01 22:44:51 +08:00
7c802bdf47
feat: API 代理地址支持环境变量配置,本地开发指向 127.0.0.1:3000
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
2026-06-27 12:42:48 +08:00
8da983b0eb
feat: add Worker status section to Servers page
...
- New WorkerInfo API type + getWorkerStatus() in server-api.ts
- WorkerStatusSection component: online/stale/offline cards
with instanceId, version, hostname, queues, heartbeat age
- Auto-refresh every 15s
- Register /servers route (SUPER_ADMIN only)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 22:03:08 +08:00
9e36c10d31
fix: replace all any types with proper interfaces
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
2026-06-19 15:36:55 +08:00
d07bca4897
fix: correct API type for kb-list in KnowledgeSources
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
2026-06-19 15:35:25 +08:00
f6f9ab2ef0
feat: implement knowledge sources admin page
Deploy Admin Frontend / build-and-deploy (push) Failing after 9s
2026-06-19 15:32:05 +08:00
de6b7e9b65
fix: revert ConfigProvider pagination prop
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
2026-06-19 15:21:32 +08:00
ce08736c3a
fix: add defaultPageSize: 20 to all table pagination configs
Deploy Admin Frontend / build-and-deploy (push) Failing after 6s
2026-06-19 15:20:06 +08:00
4d093c2c26
fix: use pageSize instead of defaultPageSize in ConfigProvider
Deploy Admin Frontend / build-and-deploy (push) Failing after 10s
2026-06-19 15:18:28 +08:00
209c0e9fb3
fix: use ConfigProvider pagination prop for defaultPageSize
Deploy Admin Frontend / build-and-deploy (push) Failing after 7s
2026-06-19 15:16:42 +08:00
b0cfe2ed48
fix: set global table defaultPageSize to 20
Deploy Admin Frontend / build-and-deploy (push) Failing after 6s
2026-06-19 15:15:55 +08:00
57aac73eff
fix: add 'read' to progressStatusLabels
Deploy Admin Frontend / build-and-deploy (push) Successful in 12s
2026-06-19 15:13:26 +08:00
fd40b0ef36
fix: add kbName render to chat-logs knowledgeBaseId column
Deploy Admin Frontend / build-and-deploy (push) Successful in 11s
2026-06-19 13:30:35 +08:00
a19138871f
fix: add file-name to contentType labels
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
2026-06-19 13:27:31 +08:00
2400e48777
fix: add Chinese labels for security-events type/risk/result
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
2026-06-19 13:25:20 +08:00
def5c953be
fix: map record titles to Chinese (covers historical English data)
Deploy Admin Frontend / build-and-deploy (push) Successful in 12s
2026-06-19 13:23:44 +08:00
972a80d4af
fix: format position as readable string instead of raw JSON
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
2026-06-19 13:17:37 +08:00
252b159537
fix: add 'new' to scheduleStateLabels
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
2026-06-19 13:16:13 +08:00
c758a2cec8
fix: add Chinese mime type + purpose labels for FilesAdmin
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
2026-06-19 13:15:23 +08:00
e07f09002d
fix: ImportMonitor labels + Progress kbName
Deploy Admin Frontend / build-and-deploy (push) Successful in 12s
2026-06-19 13:13:54 +08:00
5dd35a1c9f
feat(ADMIN-INFO-015): add userName render to userId columns across 8 pages
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
- Billing, ChatLogs, ContentSafety, NotificationAdmin, SecurityEvents
- ComplianceAdmin (deletions + exports)
- MemberManagement (members + deletion requests)
- ComplianceAdmin status labels also fixed
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 13:07:59 +08:00
7ebe092f3f
feat(ADMIN-INFO-014): add Chinese status labels across 8 admin pages
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 13s
- labels.ts: add 15 new label maps (review, import, admin, kb, etc.)
- ReviewAdmin: status/scheduleState/difficulty + filter dropdown
- KnowledgeBases: status
- KnowledgeOps: userId + status
- BackupAdmin: status (both backup & cleanup)
- Secrets: status
- ReleaseAdmin: status
- HermesSettings: agent task + artifact status
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 13:06:57 +08:00
83a7b56945
fix: prevent parent menu items from navigating, only toggle submenu
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
2026-06-19 12:53:27 +08:00
14bc16ea01
fix: handle undefined in mode label render
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
2026-06-19 12:51:24 +08:00
a30bfcf087
fix: add mode labels for learning sessions
Deploy Admin Frontend / build-and-deploy (push) Failing after 10s
2026-06-19 12:50:14 +08:00
129a9b9abc
fix: show user/kb names in LearningData page
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
2026-06-19 12:48:01 +08:00
8da90c721b
fix: remove duplicate render on RecordPage materialId
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
2026-06-19 12:46:13 +08:00
ba4e35d413
feat: show user/kb/material names in admin learning tables
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 7s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 12:44:54 +08:00
e2d94742e2
feat: show userName/kbName/materialName in admin learning tables
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 10s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 12:44:31 +08:00
60b6100466
feat: add Chinese labels for admin learning data pages
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 10s
- New constants/labels.ts with all enum → Chinese mappings
- DataPages.tsx: all render() functions use labels
- Dashboard.tsx: eventType shows Chinese
- LearningData.tsx: session status shows Chinese
- Filter dropdowns also show Chinese options
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 12:36:54 +08:00
5de0b0ecaf
refactor: merge admin/learning into admin-api/learning, restore API isolation
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 11s
- Move AdminLearningService + DTOs to learning-session module
- Merge 21 new endpoints into existing admin-api/learning controller
- Add analysis and ai-usage methods to unified service
- Delete admin-learning module (no longer needed)
- Revert JwtAuthGuard /api/admin bypass (was breaking isolation)
- Fix: /api/* now exclusively serves user/iOS traffic again
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 19:26:04 +08:00
3b825a1cf2
fix: add missing learning sub-page routes in App.tsx
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 10s
9 sub-pages (events, sessions, progress, daily, records, timeline,
anomalies, user-diagnose, material-diagnose) were defined in
routes/index.tsx but not registered as React Router <Route> elements,
causing 404 for all /learning/* pages except dashboard and replay.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 18:00:49 +08:00
e69930f7f4
feat: Admin 管理后台学习功能 - 路由、菜单、类型定义
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 12s
- App.tsx: 主应用更新
- menu.tsx: 菜单配置新增学习模块
- routes/index.tsx: 路由注册
- types/learning.ts: 学习相关类型定义
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 11:23:01 +08:00
6ad24aabe4
fix: add back /learning-data menu item
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 11s
Missing from original menu after regroup. Now 33/33 paths verified.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 22:17:41 +08:00
b05e5d86c7
fix: restore all original menu items, regroup into 6 categories
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 11s
All original entries preserved. New grouping:
- 总览
- 用户与权限 (管理员/普通用户/会员与额度)
- 知识库 (知识库+知识源+运维+发布+导入+文件+复习)
- 学习数据 (Dashboard/事件/会话/进度/每日/记录/时间线/异常/诊断)
- 系统运维 (Hermes/限流/安全/密钥/监控/AI/服务器/对话/事件/向量/配置/备份/缓存/通知/内容安全)
- 合规与报表 (合规/审计/报表/API用量/项目)
- 系统配置
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 22:09:02 +08:00
699f9012e0
refactor: organize admin menu into categories
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s
Before: 17 flat first-level items, 14 under single "系统运维"
After: 5 groups — 总览/用户管理/知识库/学习数据/系统
- AdminMenuItem.path → optional for group headers
- Breadcrumb map updated to match new structure
- Removed unused entries (hermes/servers/billing/git/etc.)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 22:06:11 +08:00
d697877056
chore: remove TaskAssistant from admin
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
Remove /assistant route, menu item, breadcrumb from App.tsx,
routes/index.tsx, menu.tsx, AdminLayout.tsx.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 22:01:21 +08:00
c2f9c376d0
fix: resolve all TypeScript build errors in admin
...
Deploy Admin Frontend / build-and-deploy (push) Successful in 11s
- DataPages.tsx: add any type annotation to all onRow callbacks
(ReadingEvent/Session/Anomaly/Record/Progress)
- ReplayPage.tsx: remove unused dayjs import
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:50:47 +08:00
42c3a604ab
fix: implement session-to-events cross-page navigation
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 6s
- Session detail: add "查看关联事件" button linking to /learning/events
- ReadingEventPage: read clientSessionId from URL search params on mount
- ReadingEventPage: add Client Session ID filter input
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:47:25 +08:00
37d5a51514
feat: add clientSessionId filter to SessionPage (ADMIN-INFO-013)
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 7s
- SessionPage already had full implementation by user
- Added clientSessionId filter input for active/interrupted session search
- Detail drawer already covers 16 fields including session diagnostics
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:44:22 +08:00
de415ff3c1
fix: add materialId filter + column to RecordPage
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 6s
Review finding: missing materialId filter input and list column.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:38:16 +08:00
0fd0709b8b
feat: UserTimelinePage with Timeline component (ADMIN-INFO-009)
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 8s
- UserTimelinePage: userId input → API query → Ant Design Timeline
- Supports array timeline + fallback JSON view for unknown formats
- Loading / empty / error states
- Route: /learning/timeline
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:34:49 +08:00
a2cb0681d9
feat: RecordPage with filter + detail drawer (ADMIN-INFO-008)
...
Deploy Admin Frontend / build-and-deploy (push) Failing after 8s
- Add userId filter input to LearningRecord list
- Add click-to-view detail Drawer with full record info
- Fix occurredAt formatting to use dayjs
- Add scroll for narrow displays
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:26:44 +08:00