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:
-rw-r--r--web/service/inbound.go11
-rw-r--r--xray/client_traffic.go1
2 files changed, 12 insertions, 0 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 5c6083ee..49916b52 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -1959,6 +1959,15 @@ func (s *InboundService) GetClientTrafficTgBot(tgId int64) ([]*xray.ClientTraffi
return nil, err
}
+ // Populate UUID and other client data for each traffic record
+ for i := range traffics {
+ if ct, client, e := s.GetClientByEmail(traffics[i].Email); e == nil && ct != nil && client != nil {
+ traffics[i].Enable = client.Enable
+ traffics[i].UUID = client.ID
+ traffics[i].SubId = client.SubID
+ }
+ }
+
return traffics, nil
}
@@ -1971,6 +1980,7 @@ func (s *InboundService) GetClientTrafficByEmail(email string) (traffic *xray.Cl
}
if t != nil && client != nil {
t.Enable = client.Enable
+ t.UUID = client.ID
t.SubId = client.SubID
return t, nil
}
@@ -2012,6 +2022,7 @@ func (s *InboundService) GetClientTrafficByID(id string) ([]xray.ClientTraffic,
for i := range traffics {
if ct, client, e := s.GetClientByEmail(traffics[i].Email); e == nil && ct != nil && client != nil {
traffics[i].Enable = client.Enable
+ traffics[i].UUID = client.ID
traffics[i].SubId = client.SubID
}
}
diff --git a/xray/client_traffic.go b/xray/client_traffic.go
index 4bb164d2..fcb2585e 100644
--- a/xray/client_traffic.go
+++ b/xray/client_traffic.go
@@ -7,6 +7,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:"-"`
SubId string `json:"subId" form:"subId" gorm:"-"`
Up int64 `json:"up" form:"up"`
Down int64 `json:"down" form:"down"`