mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 19:39:35 +03:00
API: Add user online stats (#3637)
* add statsUserOnline bool to policy * add OnlineMap struct to stats * apply UserOnline functionality to dispatcher * add statsonline api command * fix comments * Update app/stats/online_map.go Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com> * improve AddIP * regenerate pb --------- Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>
This commit is contained in:
@ -11,6 +11,7 @@ type Policy struct {
|
||||
DownlinkOnly *uint32 `json:"downlinkOnly"`
|
||||
StatsUserUplink bool `json:"statsUserUplink"`
|
||||
StatsUserDownlink bool `json:"statsUserDownlink"`
|
||||
StatsUserOnline bool `json:"statsUserOnline"`
|
||||
BufferSize *int32 `json:"bufferSize"`
|
||||
}
|
||||
|
||||
@ -34,6 +35,7 @@ func (t *Policy) Build() (*policy.Policy, error) {
|
||||
Stats: &policy.Policy_Stats{
|
||||
UserUplink: t.StatsUserUplink,
|
||||
UserDownlink: t.StatsUserDownlink,
|
||||
UserOnline: t.StatsUserOnline,
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user