mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-27 02:24:40 +00:00
Compare commits
2 commits
5d93eae438
...
bee4c75a5a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bee4c75a5a | ||
|
|
299572a4c2 |
2 changed files with 3 additions and 1 deletions
|
|
@ -1970,8 +1970,8 @@ func (s *InboundService) GetClientTrafficByEmail(email string) (traffic *xray.Cl
|
|||
return nil, err
|
||||
}
|
||||
if t != nil && client != nil {
|
||||
// Ensure enable mirrors the client's current enable flag in settings
|
||||
t.Enable = client.Enable
|
||||
t.SubId = client.SubID
|
||||
return t, nil
|
||||
}
|
||||
return nil, nil
|
||||
|
|
@ -2012,6 +2012,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].SubId = client.SubID
|
||||
}
|
||||
}
|
||||
return traffics, err
|
||||
|
|
|
|||
|
|
@ -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"`
|
||||
SubId string `json:"subId" form:"subId" gorm:"-"`
|
||||
Up int64 `json:"up" form:"up"`
|
||||
Down int64 `json:"down" form:"down"`
|
||||
AllTime int64 `json:"allTime" form:"allTime"`
|
||||
|
|
|
|||
Loading…
Reference in a new issue