Commit Graph

243 Commits

Author SHA1 Message Date
admin 0d08bcc0f8 perf: 大幅优化静态文件下载性能
- 使用 http.ServeFile 替代手动实现,利用 sendfile 零拷贝
- gzip 中间件跳过 /uploads/ 路径,避免额外开销
- 支持 Range 请求和断点续传(由标准库自动处理)
- 移除不必要的手动 MIME 类型映射

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 23:46:26 +08:00
admin 6c191d1b0d perf: 优化静态文件下载性能,支持断点续传
- 替换 Gin 默认 Static 为自定义处理器
- 支持 Range 请求头,实现断点续传
- 使用 1MB 大缓冲区,减少系统调用次数
- 添加 Accept-Ranges 和精确 Content-Length 响应头
- 设置正确的 MIME 类型映射

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 23:08:53 +08:00
admin 21b337f7c3 fix: 修复 Megaphone 图标导入拼写错误 2026-06-06 12:29:11 +08:00
admin 1cb8f11acd fix: 修复系统设置动态注入到静态文件
- 简化前端 useSiteSettings,直接使用后端注入的 window.__SITE_CONFIG__
- 修复后端 serveIndexHTML 中的设置 key 名,与前端的 key 名一致
- site_name 替换为正确的数据库字段名
- logo 和 favicon 使用 site_logo 和 site_favicon
- 添加 getLogo 函数根据主题自动选择 logo

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 13:59:03 +08:00
admin 53ab7fd778 fix: 修复系统设置的动态注入问题
- 创建 useSiteSettings composable 在应用启动时加载系统设置
- 从 window.__SITE_CONFIG__(后端注入)和 localStorage 初始化设置
- 修复 favicon 更新逻辑,正确移除旧 favicon 并添加新的
- 在路由守卫中设置页面标题,格式为 '页面名 - 网站名'
- 简化 admin.vue 和 admin-sidebar 组件,使用统一的设置管理

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 13:15:31 +08:00
admin 7eb232fd8e fix: 恢复 SidebarRail 拖拽鼠标样式,移除右上角主题设置弹窗
- 恢复 SidebarRail 的 cursor-w-resize/cursor-e-resize 样式
- 移除右上角的 ThemePopover 组件

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 12:53:10 +08:00
admin e89b212dbb fix: 修复侧边栏拖拽区域的国际化文案和鼠标样式
- 添加 toggleSidebar 的中英文翻译
- 移除无效的拖拽鼠标样式,改为 pointer
- 使用 i18n 替换硬编码的英文文本

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 05:15:24 +08:00
admin 3716a2a80f fix: 修复 DataTable 组件未传递 onDownloadFullPackage prop
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 05:06:27 +08:00
admin bba8f5bdb8 fix: 补丁版本总是显示下载完整包按钮
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 04:53:37 +08:00
admin fd6384191c feat: 版本管理页面添加下载补丁包和完整包的操作按钮
- 补丁类型版本显示两个下载按钮:下载补丁包、下载完整包
- 全量版本显示一个下载按钮
- 添加相应的中英文翻译

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 04:12:21 +08:00
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 1575d32133 feat: 添加编辑页面基础版本选择功能
- 在编辑页面添加基础版本选择器
- 加载已有版本时自动填充 base_version_id
- 更新版本时传递 base_version_id 参数
- 移除创建页面的调试代码

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 00:30:16 +08:00
admin bcde5abfa3 debug: 添加 update_type 调试显示
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 23:15:17 +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 b86fc60741 feat: 添加文件上传进度和速度显示
- 新增 api.postFormDataWithProgress 方法支持上传进度回调
- 版本创建和编辑页面显示上传进度条和实时速度
- 按钮显示上传百分比
- 添加国际化翻译

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 22:01:16 +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 47f1e9fe43 fix: show existing files when editing version
- Load files data when fetching version info
- Display uploaded file info with re-upload option
- Preserve original file data when canceling re-upload
- Add i18n for reupload button

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 00:58:36 +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 87fba96264 fix: remove auto v prefix from version display
Display raw version number from database without adding v prefix

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:55:28 +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 677546d139 fix: default SSH port to 22 if not set
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 15:32:30 +08:00
admin 11323977b9 fix: use sshpass for password auth and add port support
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 15:27:37 +08:00
admin c3418c2a11 feat: add SSH deploy step after Docker build
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 15:24:47 +08:00
admin 4aa3f33fac feat: add workflow_dispatch for manual trigger
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 14:54:40 +08:00
admin f41917e414 feat: add Gitea Actions workflow for Docker build
Add workflow similar to kankanjiao for building and pushing
Docker images to git.viaeon.com container registry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 14:50:33 +08:00
admin 4b60c06fa0 chore: update Claude permissions and add id-token write permission
- Add various tool permissions to settings.local.json
- Add id-token: write permission to docker workflow

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 14:46:31 +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