Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahGozar <info@developermen.ir>2025-09-17 18:45:28 +0300
committerGitHub <noreply@github.com>2025-09-17 18:45:28 +0300
commitfcdeb1fc79574175df0021bf4cdf03438eab0620 (patch)
treea848317439d8b75e0c16dafce4d430ffcc84ff03
parent0a58b5e745f5a4eb279e4584b1d4e32a08a243ee (diff)
feat: add UUID to ClientTraffic (#3491)
* Update client_traffic.go * Update inbound.go
-rw-r--r--web/service/inbound.go2
-rw-r--r--xray/client_traffic.go1
2 files changed, 3 insertions, 0 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index b0aed169..d6955992 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -1953,6 +1953,7 @@ func (s *InboundService) GetClientTrafficByEmail(email string) (traffic *xray.Cl
if t != nil && client != nil {
t.Enable = client.Enable
t.SubId = client.SubID
+ t.UUID = client.ID
return t, nil
}
return nil, nil
@@ -1994,6 +1995,7 @@ func (s *InboundService) GetClientTrafficByID(id string) ([]xray.ClientTraffic,
if ct, client, e := s.GetClientByEmail(traffics[i].Email); e == nil && ct != nil && client != nil {
traffics[i].Enable = client.Enable
traffics[i].SubId = client.SubID
+ traffics[i].UUID = client.ID
}
}
return traffics, err
diff --git a/xray/client_traffic.go b/xray/client_traffic.go
index 84c509ac..6300269e 100644
--- a/xray/client_traffic.go
+++ b/xray/client_traffic.go
@@ -5,6 +5,7 @@ type ClientTraffic struct {
InboundId int `json:"inboundId" form:"inboundId"`
Enable bool `json:"enable" form:"enable"`
Email string `json:"email" form:"email" gorm:"unique"`
+ UUID string `json:"uuid" form:"uuid" gorm:"unique;type:char(36)"`
SubId string `json:"subId" form:"subId" gorm:"-"`
Up int64 `json:"up" form:"up"`
Down int64 `json:"down" form:"down"`