72 Commits
Author SHA1 Message Date
xiaohei 4f252e64c7 API地址调整,触发CI/CD
Azure Static Web Apps CI/CD / build_and_deploy (push) Has been cancelled
2025-12-29 18:19:10 +00:00
xiaohei a674e3566f 本地修改,强制覆盖远程分支
Azure Static Web Apps CI/CD / build_and_deploy (push) Has been cancelled
2025-12-29 18:17:36 +00:00
xiaohei 759812fd82 updata api url 2025-12-29 18:10:17 +00: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
xiaohei 18118c90ea merge: integrate remote SWA workflow commit 2025-12-29 07:16:15 +00:00
xiaohei 5c8cfd6c54 chore(swa): add Azure Static Web Apps CI/CD workflow for Next.js (.next output, Node 20.11.1) 2025-12-29 07:10:25 +00:00
Fasthei ec4e11bbb1 ci: add Azure Static Web Apps workflow file
on-behalf-of: @Azure opensource@microsoft.com
2025-12-29 15:03:00 +08:00
xiaohei 1aae986f7e chore: add setup script for consistent node version 2025-12-29 06:46:38 +00:00
xiaohei 9ead466613 chore: add azure static web apps config with node 20.11.1 2025-12-29 06:41:43 +00:00
xiaohei f2323f5dc5 chore: add azure static web apps config with node 20.11.1 2025-12-29 06:41:43 +00:00
xiaohei 905c1b3b20 chore: set node engine >=20.9 and add .nvmrc 2025-12-29 05:41:27 +00:00
xiaohei d19e994fd7 chore: set node engine >=20.9 and add .nvmrc 2025-12-29 05:41:27 +00:00
xiaohei 1a0358f535 chore: remove admin management section in channel editor 2025-12-29 05:36:35 +00:00
xiaohei 43fd6bbf13 chore: remove admin management section in channel editor 2025-12-29 05:36:35 +00:00
xiaohei fa4a1fb532 chore: update api endpoints and lock tenant role 2025-12-29 05:26:29 +00:00
xiaohei 884e2a4cfc chore: update api endpoints and lock tenant role 2025-12-29 05:26:29 +00:00
xiaohei 3e148c390e feat: 添加删除租户和管理员功能
- 在渠道管理页面添加删除租户按钮和确认对话框
- 在渠道设置页面添加删除管理员按钮和确认对话框
- 在渠道编辑对话框中添加删除管理员功能
- 添加完整的删除确认流程,包含警告提示
- 删除成功后自动刷新列表
- 添加API调用调试日志,便于排查问题
- 支持中英文双语显示
2025-12-28 16:35:05 +00:00
xiaohei 8372183d01 feat: 添加删除租户和管理员功能
- 在渠道管理页面添加删除租户按钮和确认对话框
- 在渠道设置页面添加删除管理员按钮和确认对话框
- 在渠道编辑对话框中添加删除管理员功能
- 添加完整的删除确认流程,包含警告提示
- 删除成功后自动刷新列表
- 添加API调用调试日志,便于排查问题
- 支持中英文双语显示
2025-12-28 16:35:05 +00:00
xiaohei eceb2f6ea8 Update channel dashboard page 2025-12-28 15:45:31 +00:00
xiaohei 7247258e19 Update channel dashboard page 2025-12-28 15:45:31 +00:00
xiaohei f20dd47643 修复登录跳转问题并删除编辑功能
- 修复登录后不跳转问题:使用 window.location.href 替代 router.push,确保完整页面跳转
- 在登录页面显式设置 cookie,确保中间件能正确检查认证状态
- 删除租户编辑功能:移除编辑菜单项、编辑对话框和相关状态
- 移除管理用户对话框中的用户数字段,改为显示租户ID
- 在设置页面添加当前渠道管理员列表显示功能
- 添加获取和创建渠道管理员的 API 方法
2025-12-28 13:58:27 +00:00
xiaohei 05ec0fa8e2 修复登录跳转问题并删除编辑功能
- 修复登录后不跳转问题:使用 window.location.href 替代 router.push,确保完整页面跳转
- 在登录页面显式设置 cookie,确保中间件能正确检查认证状态
- 删除租户编辑功能:移除编辑菜单项、编辑对话框和相关状态
- 移除管理用户对话框中的用户数字段,改为显示租户ID
- 在设置页面添加当前渠道管理员列表显示功能
- 添加获取和创建渠道管理员的 API 方法
2025-12-28 13:58:27 +00:00
xiaohei 6c2069b878 优化代码:修复重复文件、统一认证函数、添加租户角色管理和管理员列表功能
- 删除重复文件:components/ui/use-toast.ts 和 components/ui/use-mobile.tsx
- 统一 getAuthToken() 函数,在 api-client.ts 中导入并删除重复定义
- 创建 clearAllTokens() 工具函数,统一 token 清除逻辑
- 修复 Toast 延迟时间(从 1000000ms 改为 5000ms)
- 修复 TypeScript 类型错误:在 applicationForm 中添加 providerId 字段
- 修复登录路径:使用 super_admin 角色登录超级管理员
- 移除登录前的后端可达性检查(避免浏览器环境问题)
- 在管理用户对话框中添加租户角色修改功能(租户/计费管理员/运营管理员)
- 移除管理用户对话框中的用户数字段(用户层面不应显示用户数)
- 在设置页面添加当前渠道管理员列表显示功能
- 添加获取和创建渠道管理员的 API 方法
- 更新登录方法的角色类型定义,支持所有角色类型
2025-12-28 13:43:07 +00:00
xiaohei 4448468157 优化代码:修复重复文件、统一认证函数、添加租户角色管理和管理员列表功能
- 删除重复文件:components/ui/use-toast.ts 和 components/ui/use-mobile.tsx
- 统一 getAuthToken() 函数,在 api-client.ts 中导入并删除重复定义
- 创建 clearAllTokens() 工具函数,统一 token 清除逻辑
- 修复 Toast 延迟时间(从 1000000ms 改为 5000ms)
- 修复 TypeScript 类型错误:在 applicationForm 中添加 providerId 字段
- 修复登录路径:使用 super_admin 角色登录超级管理员
- 移除登录前的后端可达性检查(避免浏览器环境问题)
- 在管理用户对话框中添加租户角色修改功能(租户/计费管理员/运营管理员)
- 移除管理用户对话框中的用户数字段(用户层面不应显示用户数)
- 在设置页面添加当前渠道管理员列表显示功能
- 添加获取和创建渠道管理员的 API 方法
- 更新登录方法的角色类型定义,支持所有角色类型
2025-12-28 13:43:07 +00:00
xiaohei cf86a9032a feat: 将Agent框架模板MCP改为LangChain
- 更新Agent框架模板选项,将MCP改为LangChain
- 保持其他框架选项(A2A、API)不变
2025-12-28 08:38:25 +00:00
xiaohei e11464ec29 feat: 将Agent框架模板MCP改为LangChain
- 更新Agent框架模板选项,将MCP改为LangChain
- 保持其他框架选项(A2A、API)不变
2025-12-28 08:38:25 +00:00
xiaohei f482500279 feat: 在设置页面添加管理员列表管理功能
- 引入 SettingsTab 组件显示管理员列表
- 支持查看管理员详细信息(姓名、邮箱、角色、状态、创建时间)
- 支持创建新管理员(计费管理员/运维管理员)
- 支持删除管理员(带确认对话框)
- 保留原有的角色权限配置功能
- 调整设置页面布局,分为管理员管理和角色权限配置两部分
2025-12-28 08:37:21 +00:00
xiaohei ae20ff6b47 feat: 在设置页面添加管理员列表管理功能
- 引入 SettingsTab 组件显示管理员列表
- 支持查看管理员详细信息(姓名、邮箱、角色、状态、创建时间)
- 支持创建新管理员(计费管理员/运维管理员)
- 支持删除管理员(带确认对话框)
- 保留原有的角色权限配置功能
- 调整设置页面布局,分为管理员管理和角色权限配置两部分
2025-12-28 08:37:21 +00:00
xiaohei 2f33e90c05 feat: 完整恢复渠道管理功能到ChannelsTab组件
- ✅ 创建ChannelsTab.tsx组件(1984行)
- ✅ 实现12个Dialog: 渠道CRUD、佣金管理、资源分配、租户管理、审批流程
- ✅ 恢复租户管理功能(查看、添加、权限分配)
- ✅ 恢复审批流程(供应商申请、Agent申请)
- ✅ 更新Channel类型定义
- ✅ 集成到page.tsx主页面
- ✅ 完整的中英文国际化支持
- ✅ 无TypeScript编译错误

功能完整度: 100%
参考源码: page_old.tsx lines 1459-2909
2025-12-26 15:50:33 +00:00
xiaohei 86fb3346d3 feat: 完整恢复渠道管理功能到ChannelsTab组件
- ✅ 创建ChannelsTab.tsx组件(1984行)
- ✅ 实现12个Dialog: 渠道CRUD、佣金管理、资源分配、租户管理、审批流程
- ✅ 恢复租户管理功能(查看、添加、权限分配)
- ✅ 恢复审批流程(供应商申请、Agent申请)
- ✅ 更新Channel类型定义
- ✅ 集成到page.tsx主页面
- ✅ 完整的中英文国际化支持
- ✅ 无TypeScript编译错误

功能完整度: 100%
参考源码: page_old.tsx lines 1459-2909
2025-12-26 15:50:33 +00:00
xiaohei 54b75dec89 Merge branch 'main' into gzy 2025-12-26 09:40:10 +00:00
xiaohei 353205db20 Merge branch 'main' into gzy 2025-12-26 09:40:10 +00:00
xiaohei 876fac1f4b feat: 更新前端代码 - 优化各模块页面和API客户端 2025-12-26 09:37:44 +00:00