Commit Graph

122 Commits

Author SHA1 Message Date
admin 62ea1da578 fix: 修复补丁包返回逻辑,download_url 应返回补丁包地址
- 当最新版本是补丁类型时,download_url 返回补丁包地址(FilePath)
- full_package_url 返回完整包地址作为备选
- 简化判断逻辑,不再根据客户端版本判断

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:50:41 +08:00
admin 8b887f432b fix: 简化检测更新 API 返回数据,移除 files 字段
- 移除 ZIP 包内文件列表的返回,客户端只需要补丁包/完整包信息
- 返回数据更简洁:download_url, file_size, file_hash, patch_url 等

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:47:21 +08:00
admin 0d60037e4e fix: 修复检测更新 API 正确处理补丁包
- 当最新版本是补丁类型且客户端版本是基础版本时,返回补丁包地址
- 当最新版本是补丁类型但客户端不是基础版本时,返回完整包地址
- 添加 full_package_url/full_package_size/full_package_hash 字段作为备选
- 移除冗余的补丁查询逻辑

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:21:16 +08:00
admin beae161078 feat: 创建和编辑版本时保存文件列表到数据库
- 在 CreateVersionRequest 和 UpdateVersionRequest 中添加 Files 字段
- 创建版本时保存文件列表到 VersionFile 表
- 更新版本时删除旧文件记录并创建新的
- 前端创建和编辑版本时传递文件列表
- 修复检测更新 API 使用正确的字段名 (publish_status=published)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 03:07:42 +08:00
admin 97dbd76414 fix: 修复检测更新 API 使用正确的字段名
- 将 status 字段改为 publish_status
- 将 active 值改为 published
- 确保能正确查询已发布的版本

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 02:54:02 +08:00
admin ad58d2220e feat: 添加补丁版本基础版本选择功能
- 添加基础版本下拉选择器,仅在补丁更新类型时显示
- 添加应用和更新类型的 watch 监听,自动获取全量版本列表
- 提交时传递 base_version_id 参数
- 添加调试日志便于排查问题

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 22:48:22 +08:00
admin 026581ea60 fix: 编辑补丁版本时重新合并生成全量包
当编辑版本并更新文件时,如果是补丁包类型,需要重新与基础全量包合并生成新的全量包

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 00:02:28 +08:00
admin c755587a4d feat: 完善版本管理功能
后端改进:
- 新增版本发布状态管理 (draft/published/deprecated/superseded)
- 新增发布/废弃/回滚 API 接口
- 新增增量包生成功能 (仅包含差异文件)
- 新增删除版本时的依赖检查
- 数据库字段: publish_status, superseded_by, delta_package_*

前端改进:
- 版本列表新增发布状态列和增量包大小列
- 新增发布/废弃/回滚操作按钮
- 新增增量包下载功能
- 更新国际化翻译

修复:
- 修复 announcements 页面 typeOptions 未定义问题
- 修复 echarts 模块导入类型问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 20:31:52 +08:00
admin c3e44c74da fix: fallback to FilePath when FullPackagePath is empty
When old versions don't have full_package_path set, use file_path instead

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 18:32:03 +08:00
admin 93f1e899fc refactor: simplify to maintain only one latest full package per app
- Remove per-version full package storage
- Remove RegenerateDependentVersions logic
- Only generate full package for the latest version
- Simplify package_util.go

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 12:58:43 +08:00
admin a17938c000 feat: regenerate dependent versions after deletion
- Add RegenerateFullPackage function to rebuild single version's full package
- Add RegenerateDependentVersions function to handle cascade regeneration
- Call regeneration after deleting versions
- Each version maintains its own full package independently

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 12:10:30 +08:00
admin 551f4f1576 feat: auto-generate full package when uploading patch
- Add FullPackagePath, FullPackageSize, FullPackageHash to Version model
- When uploading patch, merge with base full package to create new full package
- Check update API returns full package info for download
- Add package_util.go with merge functions

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 11:43:58 +08:00
admin fd98c0dcc4 feat: delete old file when updating version with new file
If file_path is different from existing file, remove the old file

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 10:09:23 +08:00
admin 8cb867e65b fix: save file info when updating version
- Add file_path, file_size, file_hash, entry_file to UpdateVersionRequest
- Update these fields when saving version changes
- Update originalUploadedData after successful save

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 09:25:39 +08:00
admin 0a20892f94 fix: calculate total file size on backend instead of frontend
- Backend returns total_size for all matching versions
- Frontend uses backend's total_size instead of computing from current page

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 00:11:33 +08:00
admin 275698a32b fix: return param error when version not found in database
Change 404 to 400 with "版本号参数错误" message

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 13:21:54 +08:00
admin 7af4da30d3 feat: return latest version when no version param provided
If client doesn't provide version parameter, return latest version info
instead of returning error

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 13:11:13 +08:00
admin 65a9465af4 fix: logout requires both device_id and instance_id
Only clear specific instance on specific device
Remove cross-device and all-instances clearing

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:24:23 +08:00
admin 008e66f84e fix: require instance_id when device_id is provided on logout
- Only device_id without instance_id returns error
- Three valid combinations:
  - device_id + instance_id: clear specific instance
  - only instance_id: clear instance across devices
  - no params: clear all instances

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:20:33 +08:00
admin ab3f188c04 fix: logout only clears instances, not devices
- Remove device deletion on logout
- Only delete DeviceSession records
- Support clearing specific instance or all instances

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:18:31 +08:00
admin f5343281a3 feat: add app user routes (logout, user-info, avatar, tickets)
- Logout: clear device sessions on logout
- User info: return expiry/balance based on billing type
- Avatar upload: support jpg/png/gif/webp, max 2MB
- App tickets: create, reply, close tickets for app users
- Add ClosedAt field to Ticket model

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:09:05 +08:00
admin 5298f8f58e feat: return expiry/balance based on billing type on login
- Return expiry_at for subscription mode
- Return balance for usage-based mode
- Return is_permanent for permanent members

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 17:58:33 +08:00
admin 16c68a855b fix: version display and comparison issues
- Remove duplicate 'v' prefix in version display
- Add version string cleanup (trim spaces, remove v/V prefix)
- Use custom download URL when set
- Fix has_update logic for same version comparison

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:53:46 +08:00
admin 53fd9ff7dc feat: add custom download URL for manual update method
- Add custom_download_url field to Version model
- Show custom download URL input when update method is 'manual'
- Use platform default URL if custom URL is not set
- Add i18n translations for new field

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:06:48 +08:00
admin ed4a561704 feat: add application API documentation and C++ SDK
- Add complete API documentation for application integration (docs/API_DOCUMENT.md)
- Fix check-update API to use version ID comparison instead of string comparison
- Add validation: client version must exist in server version list
- Add support for patch/incremental updates with base_version check
- Add C++ SDK with HTTP client, JSON parser, and crypto support
- Add simple_test.cpp for standalone testing on Windows

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 11:58:44 +08:00
admin ed73bb470c feat: agent devices/sessions filter by agent-associated users only
- Add created_by field to AppUser model to track who created the user
- Set created_by when agent creates users
- Extract getAgentUserIDs() helper: finds users who recharged with agent/sub-agent cards OR were created by agent/sub-agent
- Extract getAgentAppIDs() helper: finds agent's authorized applications
- Refactor handleGetUsers and checkAgentUserPermission to use getAgentUserIDs
- Create agent-specific handleGetDevices: filter by agent user IDs + app IDs
- Create agent-specific handleGetSessions: filter by agent user IDs + app IDs
- Replace admin handler references with agent-specific handlers for GET routes
2026-05-11 11:53:43 +08:00
admin 853c22fdbe feat: add balance display, user columns, device mgmt and sessions for agent
- Backend: add balance to agent stats API
- Backend: return full user details (balance, expiry, online_status, device_count, application) in agent users API
- Backend: export admin device/session handlers, add agent routes for devices and sessions
- Backend: add card type permission check and balance deduction for agent user creation
- Backend: extract checkAgentUserPermission helper, add user edit API
- Frontend: add balance card to agent dashboard
- Frontend: add application, online_status, device_count, balance, expiry_at columns to agent user table
- Frontend: add agent devices page (reuse admin data-table component)
- Frontend: add agent sessions page (reuse admin data-table component)
- Frontend: add devices and sessions to agent navigation and routes
- Add i18n keys for agent devices, sessions, user columns, dashboard balance
2026-05-11 10:46:29 +08:00
admin a76a30ee78 feat: add agent user edit, card type permission check and balance deduction
- Backend: check AgentApplicationCardType.can_generate before allowing card recharge
- Backend: deduct agent balance and record consumption when creating user with card
- Backend: add GET /agent/users/:id and PUT /agent/users/:id for user edit
- Backend: extract checkAgentUserPermission helper, refactor handleUpdateUserStatus
- Frontend: add user edit page ([id].vue) with username/email/password
- Frontend: add edit action in user list dropdown menu
- Frontend: add route for agent user edit page
- Add i18n keys for agent user edit
2026-05-11 08:48:02 +08:00
admin 57e1d10689 feat: add user creation and ban/unban for agent backend
- Backend: POST /agent/users - create user with optional card recharge
- Backend: PUT /agent/users/:id/status - ban/unban user
- Frontend: add create user page for agent (select app, card type)
- Frontend: add ban/unban action in user list with confirm dialog
- Frontend: add actions dropdown column in user data table
- Fix: cloud variables records page i18n key (agent.finance.to -> agent.cloudVariables.records.to)
- Add i18n keys for agent user management (create, ban, unban)
2026-05-11 08:24:30 +08:00
admin 3cea807353 refactor: change agent cloud data permission to cloud variables only
- Rename permission from '查看云端数据' to '查看云端变量'
- Remove cloud constants API and page for agents
- Add cloud variable records API for agents (stream type)
- Add agent cloud-variables page with full variable details
- Add agent cloud-variable records page (read-only)
- Update navigation from cloud-data to cloud-variables
- Update i18n keys: cloudData -> cloudVariables
- Backend returns var_type, default_value, max_records etc.
- Records page supports dynamic columns and date filtering
2026-05-11 08:05:40 +08:00
admin 6dcb5cde02 fix: add can_view_cloud_data to login and profile API responses
- Add can_view_cloud_data field to auth login response
- Add can_view_cloud_data field to agent profile response
- Fetch latest user permissions from /agent/profile on agent layout mount
- Update localStorage with latest can_view_cloud_data value
2026-05-11 00:15:21 +08:00
admin df4ad079f3 fix: agent finance page styling and cloud data API implementation
- Fix agent finance page: confirmed backend integration is working
- Add agent cloud-variables and cloud-constants API endpoints
- Rewrite agent cloud-data page to use real API calls instead of mock data
- Fix API path: /agent/applications -> /agent/apps
- Remove 'all' value from app filter SelectItem (empty string issue)
- Add cloudData i18n keys for zh and en
- Cloud data is read-only for agents, with CanViewCloudData permission check
2026-05-10 23:38:04 +08:00
admin 409ec4f75b 修复: 1.管理员编辑代理云端数据权限switch无效(后端缺少CanViewCloudData字段) 2.代理卡密status显示disabledbanned 3.代理用户管理只显示代理/子代理卡密充值过的用户 2026-05-10 14:12:35 +08:00
admin f3b9feca6a agent后台finance和users添加服务端分页和统计 2026-05-10 08:41:49 +08:00
admin 3cbb607ff3 修复所有分页页面统计从当前页计算的问题,改为服务端统计 2026-05-10 07:04:22 +08:00
admin f198ae268e 修复admin卡密统计GORM累积条件问题、data-table传递server-pagination 2026-05-10 05:44:16 +08:00
admin ba7b6015eb 修复管理员卡密管理页面统计数据显示不准确 2026-05-10 04:44:18 +08:00
admin c495f9b417 修复代理商卡密管理页面:增加服务端筛选、批量导出、复制功能 2026-05-10 04:27:55 +08:00
admin 83cd822717 fix: 修复代理卡密统计和列表查询逻辑
- 前端使用后端返回的total字段显示总数
- 后端查询条件兼容旧数据(agent_id IS NULL AND creator_id = ?)
- handleGetStats统计接口使用相同查询逻辑

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 02:36:26 +08:00
admin d83e7dfac9 fix: 添加代理生成卡密余额检查和扣费逻辑
- 检查代理余额是否足够
- 检查并限制生成数量(1-100)
- 使用事务确保数据一致性
- 扣除代理余额
- 记录消费记录

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 02:20:45 +08:00
admin 0cc3e85714 fix: 修复代理卡密列表数据不显示问题
- Card模型添加AgentID字段
- 生成卡密时设置AgentID
- handleGetCards返回正确格式的数据(包含app_name, card_type_name, code等)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 02:04:45 +08:00
admin a2ce784ac0 fix: 修复代理生成卡密权限检查和参数问题
- 后端兼容application_id和app_id参数
- 添加卡类权限检查,确保代理只能生成有权限的卡类
- 前端使用application_id参数名
- 移除卡类显示中的billing_type原始值,改为显示价格

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 01:16:28 +08:00
admin e63753a853 feat: 添加代理获取应用详情和卡类列表API
- 添加 GET /agent/apps/:id 接口
- 返回代理有权使用的卡类列表及其价格

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 23:58:34 +08:00
admin 08b4003db8 refactor: 清理多余字段并重新设计个人中心页面 2026-05-08 23:45:11 +08:00
admin 65fa7146e8 refactor: 拆分更新类型(全量/补丁)和更新方式(自动/手动),移除force_update字段 2026-05-08 23:34:14 +08:00
admin de0de10b8d refactor: 移除min_version/base_version_id,后端自动确定基础版本 2026-05-08 23:17:53 +08:00
admin 48ec0f97f7 fix: 状态列根据是否有更新的强制版本判断生效/失效 2026-05-08 22:54:38 +08:00
admin 426290e299 fix: 添加调试日志排查版本更新不生效问题 2026-05-08 21:34:22 +08:00
admin 3b4b0ac1e3 fix: 修复版本更新时字段未正确保存的问题 2026-05-08 21:16:17 +08:00
admin 01ca9e3df1 重构版本状态为动态计算
- 状态不再写入数据库,改为查询时动态计算
- 每个应用的最新版 = 有效, 旧版 = 已失效
- 移除后端 status 筛选参数
- 移除前端 status 筛选器
- 移除编辑页的状态手动编辑
- 移除创建版本时自动更新旧版本状态的逻辑
2026-05-08 16:40:02 +08:00