mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 05:04:22 +00:00
- Update go.mod module path from mhsanaei/3x-ui/v3 to saeederamy/3x-ui/v3 - Update all 73 Go files' import paths accordingly - Fix README.fa_IR.md install command to point to fork's main branch The fork was referencing the original repo's module path in go.mod and all Go source imports, making it dependent on MHSanaei's namespace at build time. https://claude.ai/code/session_01M6d5atbWjuLTj6UwRHoK5m
32 lines
760 B
Go
32 lines
760 B
Go
package job
|
|
|
|
import (
|
|
"github.com/saeederamy/3x-ui/v3/web/service"
|
|
)
|
|
|
|
// LoginStatus represents the status of a login attempt.
|
|
type LoginStatus byte
|
|
|
|
const (
|
|
LoginSuccess LoginStatus = 1 // Successful login
|
|
LoginFail LoginStatus = 0 // Failed login attempt
|
|
)
|
|
|
|
// StatsNotifyJob sends periodic statistics reports via Telegram bot.
|
|
type StatsNotifyJob struct {
|
|
xrayService service.XrayService
|
|
tgbotService service.Tgbot
|
|
}
|
|
|
|
// NewStatsNotifyJob creates a new statistics notification job instance.
|
|
func NewStatsNotifyJob() *StatsNotifyJob {
|
|
return new(StatsNotifyJob)
|
|
}
|
|
|
|
// Run sends a statistics report via Telegram bot if Xray is running.
|
|
func (j *StatsNotifyJob) Run() {
|
|
if !j.xrayService.IsXrayRunning() {
|
|
return
|
|
}
|
|
j.tgbotService.SendReport()
|
|
}
|