iven
|
a7d33d0207
|
feat(admin): Admin V2 — Ant Design Pro 纯 SPA 重写
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Next.js SSR/hydration 与 SWR fetch-on-mount 存在根本冲突:
hydration 卸载组件时 abort 的请求仍占用后端 DB 连接,
retry 循环耗尽 PostgreSQL 连接池导致后端完全卡死。
admin-v2 使用 Vite + React + antd 纯 SPA 彻底消除此问题:
- 12 页面全部完成(Login, Dashboard, Accounts, Providers, Models,
API Keys, Usage, Relay, Config, Prompts, Logs, Agent Templates)
- ProTable + ProForm + ProLayout 统一 UI 模式
- TanStack Query + Axios + Zustand 数据层
- JWT 自动刷新 + 401 重试机制
- 全部 18 网络请求 200 OK,零 ERR_ABORTED
同时更新 troubleshooting 第 13 节和 SaaS 平台文档。
|
2026-03-30 09:35:59 +08:00 |
|
iven
|
7de294375b
|
feat(auth): 添加异步密码哈希和验证函数
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
refactor(relay): 复用HTTP客户端和请求体序列化结果
feat(kernel): 添加获取单个审批记录的方法
fix(store): 改进SaaS连接错误分类和降级处理
docs: 更新审计文档和系统架构文档
refactor(prompt): 优化SQL查询参数化绑定
refactor(migration): 使用静态SQL和COALESCE更新配置项
feat(commands): 添加审批执行状态追踪和事件通知
chore: 更新启动脚本以支持Admin后台
fix(auth-guard): 优化授权状态管理和错误处理
refactor(db): 使用异步密码哈希函数
refactor(totp): 使用异步密码验证函数
style: 清理无用文件和注释
docs: 更新功能全景和审计文档
refactor(service): 优化HTTP客户端重用和请求处理
fix(connection): 改进SaaS不可用时的降级处理
refactor(handlers): 使用异步密码验证函数
chore: 更新依赖和工具链配置
|
2026-03-29 21:45:29 +08:00 |
|
iven
|
8b9d506893
|
refactor(saas): 架构重构 + 性能优化 — 借鉴 loco-rs 模式
Phase 0: 知识库
- docs/knowledge-base/loco-rs-patterns.md — loco-rs 10 个可借鉴模式研究
Phase 1: 数据层重构
- crates/zclaw-saas/src/models/ — 15 个 FromRow 类型化模型
- Login 3 次查询合并为 1 次 AccountLoginRow 查询
- 所有 service 文件从元组解构迁移到 FromRow 结构体
Phase 2: Worker + Scheduler 系统
- crates/zclaw-saas/src/workers/ — Worker trait + 5 个具体实现
- crates/zclaw-saas/src/scheduler.rs — TOML 声明式调度器
- crates/zclaw-saas/src/tasks/ — CLI 任务系统
Phase 3: 性能修复
- Relay N+1 查询 → 精准 SQL (relay/handlers.rs)
- Config RwLock → AtomicU32 无锁 rate limit (state.rs, middleware.rs)
- SSE std::sync::Mutex → tokio::sync::Mutex (relay/service.rs)
- /auth/refresh 阻塞清理 → Scheduler 定期执行
Phase 4: 多环境配置
- config/saas-{development,production,test}.toml
- ZCLAW_ENV 环境选择 + ZCLAW_SAAS_CONFIG 精确覆盖
- scheduler 配置集成到 TOML
|
2026-03-29 19:21:48 +08:00 |
|
iven
|
5fdf96c3f5
|
chore: 提交所有工作进度 — SaaS 后端增强、Admin UI、桌面端集成
包含大量 SaaS 平台改进、Admin 管理后台更新、桌面端集成完善、
文档同步、测试文件重构等内容。为 QA 测试准备干净工作树。
|
2026-03-29 10:46:41 +08:00 |
|
iven
|
a66b675675
|
feat(saas): Phase 2 Admin Web 管理后台 — 完整 CRUD + Dashboard 统计
后端:
- 添加 GET /api/v1/stats/dashboard 聚合统计端点
(账号数/活跃服务商/今日请求/今日Token用量等7项指标)
- 需要 account:admin 权限
Admin 前端 (Next.js 14 + shadcn/ui + Tailwind + Recharts):
- 设计系统: Dark Mode OLED (#020617 背景, #22C55E CTA)
- 登录页: 双栏布局, 品牌区 + 表单
- Dashboard 布局: Sidebar 导航 + Header + 主内容区
- 仪表盘: 4 统计卡片 + AreaChart 请求趋势 + BarChart Token用量
- 8 个 CRUD 页面:
- 账号管理 (搜索/角色/状态筛选, 编辑/启用禁用)
- 服务商 (CRUD + API Key masked)
- 模型管理 (Provider筛选, CRUD)
- API 密钥 (创建/撤销, 一次性显示token)
- 用量统计 (LineChart + BarChart)
- 中转任务 (状态筛选, 展开详情)
- 系统配置 (分类Tab, 编辑)
- 操作日志 (Action筛选, 展开详情)
- 14 个 shadcn 风格 UI 组件 (手写实现)
- 类型化 API 客户端 (SaaSClient, 20+ 方法, 401 自动跳转)
- AuthGuard 路由保护 + useAuth() hook
验证: tsc --noEmit 零 error, pnpm build 13 页面成功, cargo test 21 通过
|
2026-03-27 14:06:50 +08:00 |
|