This commit is contained in:
MHSanaei 2026-04-19 21:33:11 +02:00
parent b6256bbe0b
commit ebb95b760a
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A
14 changed files with 24 additions and 14 deletions

View file

@ -73,6 +73,8 @@
:dropdown-class-name="themeSwitcher.currentTheme"> :dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option value="never">{{ i18n <a-select-option value="never">{{ i18n
"pages.inbounds.periodicTrafficReset.never" }}</a-select-option> "pages.inbounds.periodicTrafficReset.never" }}</a-select-option>
<a-select-option value="hourly">{{ i18n
"pages.inbounds.periodicTrafficReset.hourly" }}</a-select-option>
<a-select-option value="daily">{{ i18n <a-select-option value="daily">{{ i18n
"pages.inbounds.periodicTrafficReset.daily" }}</a-select-option> "pages.inbounds.periodicTrafficReset.daily" }}</a-select-option>
<a-select-option value="weekly">{{ i18n <a-select-option value="weekly">{{ i18n
@ -81,8 +83,6 @@
<a-select-option value="monthly">{{ i18n <a-select-option value="monthly">{{ i18n
"pages.inbounds.periodicTrafficReset.monthly" "pages.inbounds.periodicTrafficReset.monthly"
}}</a-select-option> }}</a-select-option>
<a-select-option value="hourly">{{ i18n
"pages.inbounds.periodicTrafficReset.hourly" }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>

View file

@ -37,7 +37,7 @@ func (j *PeriodicTrafficResetJob) Run() {
resetCount := 0 resetCount := 0
for _, inbound := range inbounds { for _, inbound := range inbounds {
resetInboundErr := j.inboundService.ResetAllTraffics() resetInboundErr := j.inboundService.ResetInboundTraffic(inbound.Id)
if resetInboundErr != nil { if resetInboundErr != nil {
logger.Warning("Failed to reset traffic for inbound", inbound.Id, ":", resetInboundErr) logger.Warning("Failed to reset traffic for inbound", inbound.Id, ":", resetInboundErr)
} }

View file

@ -1891,6 +1891,16 @@ func (s *InboundService) ResetAllTraffics() error {
return err return err
} }
func (s *InboundService) ResetInboundTraffic(id int) error {
db := database.GetDB()
result := db.Model(model.Inbound{}).
Where("id = ?", id).
Updates(map[string]any{"up": 0, "down": 0})
return result.Error
}
func (s *InboundService) DelDepletedClients(id int) (err error) { func (s *InboundService) DelDepletedClients(id int) (err error) {
db := database.GetDB() db := database.GetDB()
tx := db.Begin() tx := db.Begin()

View file

@ -271,7 +271,7 @@
"daily" = "يومياً" "daily" = "يومياً"
"weekly" = "أسبوعياً" "weekly" = "أسبوعياً"
"monthly" = "شهرياً" "monthly" = "شهرياً"
"hourly" = "hourly" "hourly" = "كل ساعة"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "تم الحصول عليه" "obtain" = "تم الحصول عليه"

View file

@ -271,7 +271,7 @@
"daily" = "Diariamente" "daily" = "Diariamente"
"weekly" = "Semanalmente" "weekly" = "Semanalmente"
"monthly" = "Mensualmente" "monthly" = "Mensualmente"
"hourly" = "hourly" "hourly" = "Cada hora"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "Recibir" "obtain" = "Recibir"

View file

@ -271,7 +271,7 @@
"daily" = "روزانه" "daily" = "روزانه"
"weekly" = "هفتگی" "weekly" = "هفتگی"
"monthly" = "ماهانه" "monthly" = "ماهانه"
"hourly" = "hourly" "hourly" = "هر ساعت"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "فراهم‌سازی" "obtain" = "فراهم‌سازی"

View file

@ -271,7 +271,7 @@
"daily" = "Harian" "daily" = "Harian"
"weekly" = "Mingguan" "weekly" = "Mingguan"
"monthly" = "Bulanan" "monthly" = "Bulanan"
"hourly" = "hourly" "hourly" = "Setiap jam"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "Dapatkan" "obtain" = "Dapatkan"

View file

@ -271,7 +271,7 @@
"daily" = "毎日" "daily" = "毎日"
"weekly" = "毎週" "weekly" = "毎週"
"monthly" = "毎月" "monthly" = "毎月"
"hourly" = "hourly" "hourly" = "毎時"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "取得" "obtain" = "取得"

View file

@ -271,7 +271,7 @@
"daily" = "Diariamente" "daily" = "Diariamente"
"weekly" = "Semanalmente" "weekly" = "Semanalmente"
"monthly" = "Mensalmente" "monthly" = "Mensalmente"
"hourly" = "hourly" "hourly" = "A cada hora"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "Obter" "obtain" = "Obter"

View file

@ -271,7 +271,7 @@
"daily" = "Günlük" "daily" = "Günlük"
"weekly" = "Haftalık" "weekly" = "Haftalık"
"monthly" = "Aylık" "monthly" = "Aylık"
"hourly" = "hourly" "hourly" = "Saatlik"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "Elde Et" "obtain" = "Elde Et"

View file

@ -271,7 +271,7 @@
"daily" = "Щодня" "daily" = "Щодня"
"weekly" = "Щотижня" "weekly" = "Щотижня"
"monthly" = "Щомісяця" "monthly" = "Щомісяця"
"hourly" = "hourly" "hourly" = "Щогодини"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "Отримати" "obtain" = "Отримати"

View file

@ -271,7 +271,7 @@
"daily" = "Hàng ngày" "daily" = "Hàng ngày"
"weekly" = "Hàng tuần" "weekly" = "Hàng tuần"
"monthly" = "Hàng tháng" "monthly" = "Hàng tháng"
"hourly" = "hourly" "hourly" = "Hàng giờ"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "Nhận" "obtain" = "Nhận"

View file

@ -271,7 +271,7 @@
"daily" = "每日" "daily" = "每日"
"weekly" = "每周" "weekly" = "每周"
"monthly" = "每月" "monthly" = "每月"
"hourly" = "hourly" "hourly" = "每小时"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "获取" "obtain" = "获取"

View file

@ -271,7 +271,7 @@
"daily" = "每日" "daily" = "每日"
"weekly" = "每週" "weekly" = "每週"
"monthly" = "每月" "monthly" = "每月"
"hourly" = "hourly" "hourly" = "每小時"
[pages.inbounds.toasts] [pages.inbounds.toasts]
"obtain" = "獲取" "obtain" = "獲取"