feat(groups): reset group traffic without touching client counters

The group page shows traffic counting per group, but the only reset
available zeroed every member client's up/down counters (and their
quotas) via bulkResetTraffic. Group traffic is a derived sum of client
traffic, so zeroing the group display previously required mutating the
clients themselves.

Add a display-only baseline: ClientGroup gains reset_up/reset_down
columns (additive, handled by AutoMigrate). ResetGroupTraffic snapshots
the group's current up/down sum into the baseline, and ListGroups now
reports max(0, sum - baseline). Client counters are left untouched and
no Xray restart is triggered. A new POST /panel/api/clients/groups/
resetTraffic endpoint drives it, creating the client_groups row when the
group exists only as a derived label.

The groups page action now calls the new endpoint; confirm/success
strings updated across all 13 locales to reflect group-only semantics.
This commit is contained in:
MHSanaei
2026-06-27 16:33:36 +02:00
parent d1c0d77023
commit 9b8a0c9b17
20 changed files with 281 additions and 41 deletions
+2 -2
View File
@@ -934,8 +934,8 @@
"deleteSuccess": "已清除 {count} 个客户端的分组。",
"resetTraffic": "重置流量",
"resetConfirmTitle": "重置分组 {name} 的流量?",
"resetConfirmContent": "这清零分组中所有 {count} 个客户端的上行/下行流量。",
"resetSuccess": "已重置 {count} 个客户端的流量。",
"resetConfirmContent": "这只会清零分组的流量计数器,不影响各个客户端的计数器。",
"resetSuccess": "已重置分组 {name} 的流量。",
"adjustSuccess": "已调整 {name} 中的 {count} 个客户端。",
"emptyForAction": "此分组尚无客户端。",
"deleteGroupOnly": "删除分组(保留客户端)",