diff --git a/database/model/model.go b/database/model/model.go index 99b71940..dcb795c7 100644 --- a/database/model/model.go +++ b/database/model/model.go @@ -92,23 +92,21 @@ type Setting struct { } type Client struct { - ID string `json:"id"` - Security string `json:"security"` - Password string `json:"password"` - Flow string `json:"flow"` - Email string `json:"email"` - LimitIP int `json:"limitIp"` - TotalGB int64 `json:"totalGB" form:"totalGB"` - ExpiryTime int64 `json:"expiryTime" form:"expiryTime"` - TrafficReset string `json:"trafficReset" form:"trafficReset" gorm:"default:never"` - LastTrafficResetTime int64 `json:"lastTrafficResetTime" form:"lastTrafficResetTime" gorm:"default:0"` - Enable bool `json:"enable" form:"enable"` - TgID int64 `json:"tgId" form:"tgId"` - SubID string `json:"subId" form:"subId"` - Comment string `json:"comment" form:"comment"` - Reset int `json:"reset" form:"reset"` - CreatedAt int64 `json:"created_at,omitempty"` - UpdatedAt int64 `json:"updated_at,omitempty"` + ID string `json:"id"` + Security string `json:"security"` + Password string `json:"password"` + Flow string `json:"flow"` + Email string `json:"email"` + LimitIP int `json:"limitIp"` + TotalGB int64 `json:"totalGB" form:"totalGB"` + ExpiryTime int64 `json:"expiryTime" form:"expiryTime"` + Enable bool `json:"enable" form:"enable"` + TgID int64 `json:"tgId" form:"tgId"` + SubID string `json:"subId" form:"subId"` + Comment string `json:"comment" form:"comment"` + Reset int `json:"reset" form:"reset"` + CreatedAt int64 `json:"created_at,omitempty"` + UpdatedAt int64 `json:"updated_at,omitempty"` } type VLESSSettings struct { diff --git a/web/html/modals/inbound_info_modal.html b/web/html/modals/inbound_info_modal.html index bca2c195..7b7b0af7 100644 --- a/web/html/modals/inbound_info_modal.html +++ b/web/html/modals/inbound_info_modal.html @@ -237,12 +237,6 @@ - - {{ i18n "pages.inbounds.periodicTrafficResetTitle" }} - - [[ i18n("pages.inbounds.periodicTrafficReset." + infoModal.clientSettings.trafficReset) ]] - - {{ i18n "pages.inbounds.IPLimit" }} diff --git a/web/service/inbound.go b/web/service/inbound.go index 83e7c925..fc145794 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -1706,47 +1706,6 @@ func (s *InboundService) ResetClientTrafficByEmail(clientEmail string) error { return err } - // Update lastTrafficResetTime in client settings - _, inbound, err := s.GetClientInboundByEmail(clientEmail) - if err != nil { - logger.Warning("Failed to get inbound for client", clientEmail, ":", err) - return nil // Don't fail the reset if we can't update the timestamp - } - - if inbound != nil { - var settings map[string]any - err = json.Unmarshal([]byte(inbound.Settings), &settings) - if err != nil { - logger.Warning("Failed to parse inbound settings:", err) - return nil - } - - clientsSettings := settings["clients"].([]any) - now := time.Now().Unix() * 1000 - - for client_index := range clientsSettings { - c := clientsSettings[client_index].(map[string]any) - if c["email"] == clientEmail { - c["lastTrafficResetTime"] = now - c["updated_at"] = now - break - } - } - - settings["clients"] = clientsSettings - modifiedSettings, err := json.MarshalIndent(settings, "", " ") - if err != nil { - logger.Warning("Failed to marshal inbound settings:", err) - return nil - } - - inbound.Settings = string(modifiedSettings) - err = db.Save(inbound).Error - if err != nil { - logger.Warning("Failed to save inbound with updated client settings:", err) - } - } - return nil }