shanshanzhong147
3d1a31a19f
修复: 用户维度限速在过期节点组分支生效 + 统一 speed_limit 单位为 Mbps
...
- getServerUserListLogic.getExpiredUsers 之前完全忽略 user_subscribe.speed_limit,
现在带出用户级覆盖并与过期节点组 speed_limit 取更严(mergeSpeedLimit:0 视为无限制)
- node_group.SpeedLimit 注释从 "KB/s" 修正为 "Mbps"(旧注释是笔误,实际下发节点的
ServerUser.SpeedLimit 字段语义就是 Mbps,节点端 ppanel-node 按 *1e6/8 换算为 Byte/s)
- apis/node/node.api 给 ServerUser.SpeedLimit 加 Mbps 单位注释
- 新增 TestMergeSpeedLimit 表驱动测试覆盖 8 种边界
主链路(活跃用户、套餐 traffic_limit 阶梯)行为不变,已在生产 (server_id=52)
验证 147 个限速用户下发正确,与 DB 完全对应。
2026-06-12 22:39:15 -07:00
shanshanzhong147
24caf58987
修复( #12 ): 优化用户列表限速计算性能 ( #14 )
...
Co-authored-by: multica-agent <github@multica.ai >
2026-06-07 23:29:15 -07:00
shanshanzhong147
19d28a8f89
修复( #1 ): 服务器用户列表缓存按 protocol 隔离 + 兜底不写缓存
...
服务器用户列表缓存跨协议污染修复(HIF-1 / 详见 PR #5 四件套):
1. 缓存 key 加 protocol 维度(`server:user:{server_id}:{protocol}`),对齐 ServerConfig 已有约定
2. 显式枚举协议清除用户列表缓存(AllProtocols + ServerUserListCacheKeysForServer),不用 SCAN
3. 三个兜底分支不写缓存 + Errorw 日志(带 server_id + protocol 字段)
4. hysteria2 → hysteria 兼容归一化 + 6 个新单测
Closes HIF-1
2026-06-03 05:37:03 -07:00
shanshanzhong147
82eff47f38
新功能( #69 ): 用户级限速覆盖 — 数据层 + 核心逻辑 + 管理接口
...
Build docker and publish / build (20.15.1) (push) Failing after 8m52s
Build docker and publish / build (20.15.1) (pull_request) Successful in 7m51s
- 新增 migration 02153: user_subscribe 表添加 speed_limit、traffic_limit 列(幂等)
- model 层 Subscribe/SubscribeDetails 新增用户级限速字段(*string 类型支持 nil 回退)
- server 用户列表和管理员详情接口支持用户级限速覆盖优先级计算
- 更新管理员订阅更新接口支持写入/清除用户级限速
Co-authored-by: multica-agent <github@multica.ai >
2026-05-27 08:07:16 -07:00
shanshanzhong147
bcefb274ab
perf(server): cache speed limit calculations
Build docker and publish / build (20.15.1) (push) Successful in 5m37s
2026-04-29 01:37:59 -07:00
shanshanzhong147
2db2bc0860
feat: 限速状态可视化 - 后台订阅详情展示实际限速与降速状态
...
Build docker and publish / build (20.15.1) (push) Successful in 8m7s
- 新增 pkg/speedlimit/calculator.go 公共限速计算函数
- UserSubscribeDetail 响应新增 effective_speed/is_throttled/throttle_rule 字段
- GetUserSubscribeById 接口查询时实时计算并返回限速状态
- 重构 getServerUserListLogic 的 calculateEffectiveSpeedLimit,改用共享函数
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-28 08:14:07 -07:00
shanshanzhong147
89e0c03fec
fix: 统一限速单位为 Mbps,与 ppanel-node 节点端对齐
...
Build docker and publish / build (20.15.1) (push) Successful in 8m1s
ppanel-node limiter.go 将 speed_limit 视为 Mbps(× 1000000 / 8 → Bytes/s),
但后端之前存储的是 Bytes(前端 mbToBits 转换),导致节点收到天文数字等于不限速。
- 回滚 traffic_limit KB→Bytes 转换,统一用 Mbps 直接比较
- 部署后需执行数据迁移:UPDATE subscribe SET speed_limit = speed_limit / 1048576 WHERE speed_limit > 0
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-27 02:46:25 -07:00
shanshanzhong147
315c59e5b7
fix: traffic_limit 限速值 KB→Bytes 转换,修复与基础限速单位不一致
...
Build docker and publish / build (20.15.1) (push) Successful in 7m56s
traffic_limit 的 speed_limit 前端输入单位是 KB,
订阅基础 speed_limit 存储单位是 Bytes,
比较和返回前需要 ×1024 转换为 Bytes,否则限速值异常偏低。
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-27 02:30:06 -07:00
EUForest
06a2425474
feat(subscribe): add traffic limit rules and user traffic stats
...
- Add subscribe traffic_limit schema and migration\n- Support traffic_limit in admin create/update and list/details\n- Apply traffic_limit when building server user list speed limits\n- Add public user traffic stats API
2026-03-14 12:41:52 +08:00
EUForest
39310d5b9a
Features:
...
- Node group CRUD operations with traffic-based filtering
- Three grouping modes: average distribution, subscription-based, and traffic-based
- Automatic and manual group recalculation with history tracking
- Group assignment preview before applying changes
- User subscription group locking to prevent automatic reassignment
- Subscribe-to-group mapping configuration
- Group calculation history and detailed reports
- System configuration for group management (enabled/mode/auto_create)
Database:
- Add node_group table for group definitions
- Add group_history and group_history_detail tables for tracking
- Add node_group_ids (JSON) to nodes and subscribe tables
- Add node_group_id and group_locked fields to user_subscribe table
- Add migration files for schema changes
2026-03-08 23:22:38 +08:00
EUForest
52ce054b35
Add: Server location latitude and longitude
2025-11-04 14:53:43 +08:00
EUForest
e0003ea074
Temporary: Cancel node cache
2025-10-28 17:48:38 +08:00
Chang lue Tsen
712e31cc60
fix(userlist): correct node ID assignment in getServerUserListLogic
2025-09-04 14:09:17 -04:00
Chang lue Tsen
60988bc2ba
fix(userlist): correct node ID assignment and update query logic for tag filtering
2025-09-04 14:05:04 -04:00
Chang lue Tsen
61ac829c37
feat(userlist): enhance GetServerUserListLogic with improved node and tag handling
2025-09-04 13:46:24 -04:00
Chang lue Tsen
0636a4bddf
feat(subscription): implement FilterList method for subscription queries and update related logic
2025-09-04 10:20:35 -04:00
Chang lue Tsen
6dc1bee14c
feat(api): refactor cache key handling for server and user lists
2025-08-31 11:29:55 -04:00
Chang lue Tsen
c7884d94aa
feat(api): migrate server and node data handling, update related structures and logic
2025-08-26 07:05:59 -04:00
Chang lue Tsen
34c09c4618
refactor: update import paths from ppanel-server to server
2025-04-25 15:09:31 +09:00
Chang lue Tsen
8addcc584b
init: 1.0.0
2025-04-25 12:08:29 +09:00