Commit Graph
78 Commits
Author SHA1 Message Date
zhanggangyong 3978ca235e feat: 添加邮箱验证码功能、删除显示名称字段、修复密码修改接口
- 在用户注册页面添加邮箱验证码输入和发送功能
- 删除注册表单和个人信息对话框中的显示名称字段
- 将用户名改为必填项
- 修复超级管理员修改租户密码时缺少channel_id参数的问题
- 改进监控仪表板API的错误处理
- 添加API接口完整清单文档
2026-01-11 17:14:47 +00:00
zhanggangyong 87cfbafc44 feat: 添加用户个人信息编辑、注册功能和现代科技蓝配色方案
- 添加个人信息编辑功能(用户名、公司信息可编辑,显示名称和邮箱只读)
- 添加修改密码功能(左下角设置)
- 添加用户注册功能(登录页面)
- 右上角通知改为卡片显示联系销售信息
- 头像显示用户名称首字母
- 修复代理工厂CPU和内存显示问题
- 应用现代科技蓝配色方案(方案一)
2026-01-11 16:22:38 +00:00
zhanggangyong 5603971f58 更新api-client和dashboard-layout 2026-01-11 15:06:03 +00:00
xiaohei 4ec6f8befd chore: sync latest pages + docs updates 2026-01-11 12:13:00 +00:00
xiaohei 5e97eb40cb feat: 添加自定义Agent管理功能
- 在工具注册表下方添加自定义Agent管理卡片
- 支持查看自定义Agent列表(名称、模板、状态、CPU、内存、运行时间)
- 支持停止运行中的Agent
- 支持重启/启动Agent
- 支持删除Agent(带确认提示)
- 添加刷新按钮手动更新列表
- 添加API方法:getUserCustomAgents, deleteCustomAgent, stopCustomAgent, restartCustomAgent
2026-01-09 16:17:21 +00:00
xiaohei c87dc658f0 feat: 在部署Agent对话框中添加使用工具选择
- 在'使用的模型'右边添加'使用工具'下拉选择
- 工具选项基于数据模板(已注册的工具)
- 更新配置摘要显示使用的工具
2026-01-09 16:13:08 +00:00
xiaohei fc0d8b253f fix: 修复渠道资源分配输入框逻辑
- 修改 CPU 和内存输入框 min 从 0.5 改为 0
- 使用 ?? 替代 || 正确处理 0 值显示
- 改进 onChange 处理,允许清空输入
- 更新提示文字,说明输入0表示不分配
- 修复摘要显示逻辑,正确判断是否有资源配置
2026-01-09 15:05:22 +00:00
xiaohei 7cbacebef1 feat: 对接代理工厂和服务网关接口
- 添加代理工厂相关API接口方法 (api-client.ts)
  - getUserAvailablePlatformAgents: 获取可用平台Agent列表
  - getUserPlatformAgentQuota: 查看配额使用情况
  - deployUserAgent: 部署Agent
  - getUserPlatformAgentInstances: 获取已部署实例列表
  - startUserPlatformAgent: 启动Agent实例
  - stopUserPlatformAgent: 停止Agent实例
  - getUserCustomAgentQuota: 获取CPU/内存配额

- 修改代理工厂页面 (agent-factory/page.tsx)
  - 对接新的后端接口获取Agent列表和配额信息
  - 添加配额使用进度条显示
  - 资源配置根据接口返回参数动态显示
  - 配额满时禁用部署按钮

- 修改服务网关页面 (model-gateway/page.tsx)
  - 平均延迟复用 model_gateway 组件的 latency 值
  - 今日调用复用 requests24h 参数

- 修改布局组件 (dashboard-layout.tsx)
  - API延迟复用 mcp_server 组件的 latency 值
2026-01-09 15:01:45 +00:00
xiaohei 85a3425420 fix: 修正系统组件默认名称 agent-manager 为 agent_manager(与后端一致) 2026-01-08 17:03:37 +00:00
xiaohei 4d23852b72 fix: 修复仪表板显示问题
1. 修改系统组件默认加载状态名称:database改为agent-manager,mode改为model_gateway
2. 修复模型分布图在没有数据时显示黑色的问题,改为显示'暂无模型使用数据'提示
2026-01-08 10:07:29 +00:00
xiaohei cae7e779a2 feat: 将供应商配置对话框的可调用模型输入框改为多选复选框
- 在 api-client.ts 中添加 getLiteLLMModels 和 getLiteLLMModelIds 方法
- 改为调用后端接口 /api/admin/resources/litellm-models 获取模型列表
- 移除前端直接调用 LiteLLM API 的敏感配置(API 密钥)
- 将 providerForm.models 类型从 string 改为 string[]
- 修改添加供应商对话框的 models 输入框为多选复选框列表
- 修改配置供应商对话框的 models 输入框为多选复选框列表
- 在打开对话框时自动加载 LiteLLM 模型列表
2026-01-08 06:42:41 +00:00
xiaohei 92e4a3fd93 feat: 将供应商配置对话框的可调用模型输入框改为多选复选框
- 在 api-client.ts 中添加 LiteLLM 模型列表获取方法
- 将 providerForm.models 类型从 string 改为 string[]
- 修改添加供应商对话框的 models 输入框为多选复选框列表
- 修改配置供应商对话框的 models 输入框为多选复选框列表
- 在打开对话框时自动加载 LiteLLM 模型列表
2026-01-08 06:36:21 +00:00
xiaohei 9f4783787c feat: 更新UI文案和API接口
- 数据与工具页面: 总API数→总工具数, 活跃Pod数→活跃的工具数, 生成新工具→部署Agent
- 代理工厂页面: 可用Agent→可用Agent类型
- api-client.ts: 修复接口路径差异, 添加deleteWorkflow和runWorkflow方法
2026-01-07 09:37:06 +00:00
xiaohei 62b680a6cf feat: 渠道合作伙伴平台功能完善
- 完善设置页面的权限配置功能
- 添加管理员列表显示
- 添加后端接口需求文档
2026-01-06 18:05:16 +00:00
xiaohei 7f66c70112 fix: 修复Agent分配功能中选择一个Agent时所有Agent都被选中的问题
- 使用 agent.id || agent.name 作为唯一标识符 (agentKey)
- 后端返回的 Agent 模板数据中 name 是唯一的,id 可能为 undefined
- 修复 handleResourceManagement 函数中加载已分配 Agent 的映射逻辑
- 确保加载和选择使用一致的标识符
2026-01-06 16:01:55 +00:00
xiaohei fd23f5d222 feat: 更新前端接口以匹配后端API文档v1.2.1
主要更新:
- 更新api-client.ts中的allocateTenantResources方法,支持customAgentQuota参数
- 修复渠道平台租户资源分配对话框的传参问题
- 添加Agent勾选框功能,只有选中的Agent才会被分配
- 添加调试日志输出请求数据

API对照:
- PUT /api/channel/tenants/{tenant_id}/resources
- agents数组元素包含agentId和quantity
- customAgentQuota包含cpuQuota和memoryQuota
2026-01-05 11:31:52 +00:00
xiaohei f43306a7b5 fix: 根据后端API文档v1.2.1更新前端接口
- 修复渠道平台模型授权状态显示逻辑(使用hasAccess字段判断)
- 修复changeTenantPassword接口参数名(new_password -> newPassword)
- 修复createAdmin接口channelId参数改为可选
- 修复渠道申请审批表格的状态显示和按钮逻辑
2026-01-05 06:56:46 +00:00
xiaohei ffb09fee13 fix: 修复资源申请弹窗Agent类型使用假数据问题
- 将硬编码的Agent类型列表替换为从API获取的真实Agent列表
- 使用agentResourcesData动态渲染Agent选项
- 当无可用Agent时显示友好提示信息
2026-01-04 11:21:57 +00:00
xiaohei f56147bbbe feat: 优化创建数据模板弹窗 - 添加上传JSON勾选框切换输入模式
- 添加勾选框控制输入模式(上传JSON文件 vs 手动输入)
- 勾选后显示文件上传界面,带APILLAMA自动识别提示
- 不勾选时显示手动输入表单(URL、密钥Key、查询参数)
- 数据接口URL改为可输入状态
2026-01-04 10:56:31 +00:00
xiaohei 1bceab125a fix: 修复渠道仪表板假数据问题
- 修复租户计费统计:使用billingStatsData.tenantStats替换硬编码数据
- 修复调用记录明细:使用billingStatsData.callRecords替换硬编码数据
- 添加加载状态和空数据提示
- 支持多种字段名兼容(timestamp/time, tenantName/tenant等)
2026-01-04 09:36:48 +00:00
xiaohei 553f41daf5 feat: 增强超级管理员监控页面Agent显示功能
- 新增agentSummary状态变量保存Agent监控汇总统计
- 更新监控页面显示Agent统计卡片(总数、健康、警告/异常)
- 优化Agent卡片显示,包含名称、类型、健康状态、资源配置等信息
- 支持healthStatus字段判断健康状态(兼容旧status字段)
2026-01-04 09:23:53 +00:00
xiaohei e4ee876f57 fix: 修复最近登录租户功能的数据加载逻辑
- 优化数据加载逻辑,优先使用 data.recentTenants 字段
- 兼容 data.tenants 字段(向后兼容)
- 支持直接数组格式
- 移除调试日志,保持代码整洁

测试验证:后端API返回正确的租户登录记录
2026-01-04 05:24:27 +00:00
xiaohei 8279de706f feat: 在概览页面增加最近登录的租户列表功能
- 在loadDashboardData中添加加载最近登录数据的代码
- 修改概览页面的'最近租户'部分为'最近登录的租户'
- 使用recentLogins数据展示租户登录信息
- 展示租户名称、邮箱、所属渠道、最后登录时间和状态
- 只展示租户登录,不展示渠道登录
2026-01-04 04:59:39 +00:00
xiaohei 521daf6527 fix: 将系统指标中的API请求/分钟改为活跃Agent
- 修改翻译文本:apiRequests -> activeAgents
- 英文:'Active Agents'
- 中文:'活跃Agent'
- 使用后端API字段:services.active_agents
- 调整max值从5000改为100
2025-12-31 10:42:33 +00:00
xiaohei f044360293 fix: 修复超级管理员控制台概览页面接口问题
1. 修复统计数据字段名与后端API不匹配问题
   - total_channels → totalChannels
   - total_tenants → totalTenants
   - total_revenue → totalRevenue

2. 修复系统指标使用正确的监控接口
   - 从 getAdminDashboardStats 改为 getMonitoringMetrics
   - 使用正确的字段: system.cpu_usage_percent, system.memory_usage_percent, system.disk_usage_percent
   - API请求数使用 services.total_executions_24h

3. 添加监控接口错误处理,避免页面崩溃
2025-12-31 10:31:37 +00:00
xiaohei eb2a88861b feat: 添加租户管理和K8s Agent API,更新文档 2025-12-31 09:11:28 +00:00
xiaohei 8c4284d38d feat: 统一API端点、增强权限系统和渠道管理员功能
- 统一所有API基础URL指向MCP服务器
- 超级管理员创建租户时支持channelId参数
- 修复硬编码localhost URL问题
- HTTP方法修正:PATCH改为PUT
- 租户状态修正:disabled改为suspended
- 新增渠道管理员列表功能(可折叠展开)
- 新增角色卡片UI(计费管理员、运营管理员)
- 新增channel_admin角色支持
- 增强错误处理显示后端具体错误信息
2025-12-30 14:07:32 +00:00
xiaohei 9374a83cab fix: 修复超级管理员创建租户功能,根据系统权限选择正确的后端接口
- 租户(tenant): 调用 /api/channel/tenants/create
- 计费管理员(billing-admin): 调用 /api/admin/admins/create
- 运营管理员(operations-admin): 调用 /api/admin/admins/create
- 删除无效的'管理员'选项
2025-12-30 06:58:46 +00:00
xiaohei d9f940db71 前端API连接相关更新 2025-12-29 19:18:59 +00:00
xiaohei 64a14f7041 更新 lib/api-client.ts 2025-12-29 19:03:04 +00:00
xiaohei f71975b392 合并并同步云端 API_BASE_URLS 2025-12-29 18:36:10 +00:00
FastheiandGitHub a44ce9b602 Update API base URLs to new Azure endpoints 2025-12-30 02:28:43 +08:00
xiaohei 484f4a1445 fix(azure): remove skip_deploy_on_missing_secrets
Token is now configured, enable full deployment.
2025-12-29 10:29:02 +00:00
xiaohei 5afd8d423b fix(azure): set app_location to /out where static files are
Since we use skip_app_build: true and is_static_export: true,
Azure SWA looks for static files directly in app_location.

Next.js static export outputs to 'out/' directory, so we point
app_location directly to '/out' where index.html exists.
2025-12-29 09:27:22 +00:00
xiaohei 0b388ce82b fix(azure): add skip_deploy_on_missing_secrets for token handling
Azure SWA recommends this parameter to gracefully handle missing
deployment tokens. When secrets are not configured, the workflow
will continue without deployment.
2025-12-29 09:23:53 +00:00
xiaohei d275a08c39 fix(azure): use correct action parameter names
- Remove invalid 'skip_deploy_on_missing_secrets' parameter
- Use 'is_static_export: true' instead of IS_STATIC_EXPORT env var
- All parameters now match Azure static-web-apps-deploy@v1 action spec
2025-12-29 09:12:43 +00:00
xiaohei c9a78c657c fix(azure): set output_location to empty string for IS_STATIC_EXPORT
When IS_STATIC_EXPORT=true, Azure SWA expects output_location to be
an empty string ('') to auto-detect Next.js static export files.

Azure will look for the app source in app_location='/' and auto-discover
the 'out' directory where Next.js static export outputs files by default.

Fixes: Cannot find default file in artifacts folder (/) error
2025-12-29 08:45:10 +00:00
xiaohei 5209a8cefe fix(azure): explicitly set output_location to 'out' for static export
When IS_STATIC_EXPORT=true, SWA needs to know where to find the
built static files. Next.js static export outputs to 'out/' directory.

Configuration:
- app_location: '/' (repository root - where source is)
- output_location: 'out' (where Next.js static export files are)
- IS_STATIC_EXPORT: true (skip Oryx build, use pre-built files)
- skip_app_build: true (we already built in npm run build step)

This tells SWA to look for index.html in the 'out' directory.
2025-12-29 08:39:43 +00:00
xiaohei 7c1eea53b7 fix(azure): set output_location to empty string when using IS_STATIC_EXPORT
When IS_STATIC_EXPORT=true is set, Azure SWA automatically detects
Next.js static export output at 'out/' directory. Explicitly setting
output_location causes artifact detection to fail.

Per Azure official documentation:
https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-static-export
2025-12-29 08:36:43 +00:00
xiaohei ca537c971e fix(azure): apply official Azure SWA static export configuration
Per Microsoft official documentation:
https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-static-export

Key changes:
- Set IS_STATIC_EXPORT=true environment variable (required for static Next.js)
- Set output_location to 'out' (Next.js static export default)
- Set api_location to empty string (no API for static export)
- Keep skip_app_build=true (we build in previous step)

This is the official Azure recommended configuration for Next.js static sites.
2025-12-29 08:31:08 +00:00
xiaohei 4511fe5694 fix(azure): apply correct Azure SWA approach for Next.js
BREAKING CHANGES:
- Switch to static export mode (output: 'export') per Azure SWA best practices
- Remove staticwebapp.config.json to avoid routes.json conflict
- Convert server-side layouts to client-side only (remove cookies() usage)
- Auth now handled entirely by client-side AuthGuard component
- Output directory changed from .next/standalone to 'out'
- Remove redirects from next.config (not supported in static export)

This aligns with Azure Static Web Apps' official recommendation for Next.js.
Server-side features (SSR, API routes, server actions) are not supported.
All authentication and routing is client-side via React components.
2025-12-29 08:05:05 +00:00
xiaohei 351512dbc9 docs: add Azure deployment guide and env example 2025-12-29 07:59:22 +00:00
xiaohei 00aef0bea8 feat(azure): apply Azure SWA best practices for Next.js
- Add standalone output mode in next.config.mjs
- Configure environment variables with .env.example
- Update staticwebapp.config.json with proper routing and fallback
- Optimize GitHub Actions workflow with npm cache and env vars
- Set output_location to .next/standalone for SWA deployment
- Preserve all business logic in API client, auth, and components
2025-12-29 07:58:24 +00:00
xiaohei 1b6c528be0 fix(swa): apply Azure best practices - remove config, use standalone Next.js build 2025-12-29 07:53:07 +00:00
xiaohei e706021329 fix(swa): simplify staticwebapp.config.json to avoid routes.json conflict 2025-12-29 07:49:19 +00:00
xiaohei bd982a83ce chore(swa): remove duplicate auto-generated workflow; keep unified azure-static-web-apps.yml 2025-12-29 07:47:36 +00:00
xiaohei a184653c82 ci(swa): skip deploy when token missing; align Next.js output to .next 2025-12-29 07:45:39 +00:00
xiaohei 2c4d606aba fix(swa): set output_location to .next and add app_build_command for Next.js 2025-12-29 07:41:18 +00:00
xiaohei 0c7693833f feat(auth): replace middleware with server-side layouts; add redirects; build verified 2025-12-29 07:28:25 +00:00
xiaohei 66c700442e feat(auth): migrate from middleware to server-side layouts; add redirects for /admin and /channel 2025-12-29 07:22:26 +00:00