diff options
| author | Ahmad Thoriq Najahi <najahi@zephyrus.id> | 2024-04-29 09:44:16 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-29 09:44:16 +0300 |
| commit | 2d209836900007b838c13ede66dd4855182bbe54 (patch) | |
| tree | 12f7d4f88d269fb62f9020cbf02f755ffc4d82d4 /web | |
| parent | 490048a975cb7cbb20008004c3f9503c082ee5b9 (diff) | |
feat(tgbot): Add `xray-core` version into server status (#2236)
Signed-off-by: Ahmad Thoriq Najahi <najahi@zephyrus.id>
Diffstat (limited to 'web')
| -rw-r--r-- | web/service/tgbot.go | 9 | ||||
| -rw-r--r-- | web/translation/translate.en_US.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.es_ES.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.fa_IR.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.id_ID.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.ru_RU.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.uk_UA.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.vi_VN.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.zh_Hans.toml | 1 |
9 files changed, 14 insertions, 3 deletions
diff --git a/web/service/tgbot.go b/web/service/tgbot.go index ad9fe2c5..b8b04f05 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -948,8 +948,14 @@ func (t *Tgbot) sendExhaustedToAdmins() { func (t *Tgbot) getServerUsage() string { info, ipv4, ipv6 := "", "", "" + + // get latest status of server + t.lastStatus = t.serverService.GetStatus(t.lastStatus) + onlines := p.GetOnlineClients() + info += t.I18nBot("tgbot.messages.hostname", "Hostname=="+hostname) info += t.I18nBot("tgbot.messages.version", "Version=="+config.GetVersion()) + info += t.I18nBot("tgbot.messages.xrayVersion", "XrayVersion=="+fmt.Sprint(t.lastStatus.Xray.Version)) // get ip address netInterfaces, err := net.Interfaces() @@ -978,9 +984,6 @@ func (t *Tgbot) getServerUsage() string { info += t.I18nBot("tgbot.messages.ipv6", "IPv6=="+ipv6) } - // get latest status of server - t.lastStatus = t.serverService.GetStatus(t.lastStatus) - onlines := p.GetOnlineClients() info += t.I18nBot("tgbot.messages.serverUpTime", "UpTime=="+strconv.FormatUint(t.lastStatus.Uptime/86400, 10), "Unit=="+t.I18nBot("tgbot.days")) info += t.I18nBot("tgbot.messages.serverLoad", "Load1=="+strconv.FormatFloat(t.lastStatus.Loads[0], 'f', 2, 64), "Load2=="+strconv.FormatFloat(t.lastStatus.Loads[1], 'f', 2, 64), "Load3=="+strconv.FormatFloat(t.lastStatus.Loads[2], 'f', 2, 64)) info += t.I18nBot("tgbot.messages.serverMemory", "Current=="+common.FormatTraffic(int64(t.lastStatus.Mem.Current)), "Total=="+common.FormatTraffic(int64(t.lastStatus.Mem.Total))) diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 8a8563d3..b38245c2 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -549,6 +549,7 @@ "datetime" = "⏰ Date&Time: {{ .DateTime }}\r\n" "hostname" = "💻 Host: {{ .Hostname }}\r\n" "version" = "🚀 3X-UI Version: {{ .Version }}\r\n" +"xrayVersion" = "📡 Xray Version: {{ .XrayVersion }}\r\n" "ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n" "ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n" "ip" = "🌐 IP: {{ .IP }}\r\n" diff --git a/web/translation/translate.es_ES.toml b/web/translation/translate.es_ES.toml index 3ff5e12c..835f4351 100644 --- a/web/translation/translate.es_ES.toml +++ b/web/translation/translate.es_ES.toml @@ -547,6 +547,7 @@ "datetime" = "⏰ Fecha y Hora: {{ .DateTime }}\r\n"
"hostname" = "💻 Nombre del Host: {{ .Hostname }}\r\n"
"version" = "🚀 Versión de X-UI: {{ .Version }}\r\n"
+"xrayVersion" = "📡 Versión de Xray: {{ .XrayVersion }}\r\n"
"ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n"
"ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n"
"ip" = "🌐 IP: {{ .IP }}\r\n"
diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index 81c87dcd..547700f5 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -549,6 +549,7 @@ "datetime" = "⏰ تاریخوزمان: {{ .DateTime }}\r\n" "hostname" = "💻 ناممیزبان: {{ .Hostname }}\r\n" "version" = "🚀 نسخهپنل: {{ .Version }}\r\n" +"xrayVersion" = "📡 نسخو ڪور: {{ .XrayVersion }}\r\n" "ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n" "ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n" "ip" = "🌐 آدرسآیپی: {{ .IP }}\r\n" diff --git a/web/translation/translate.id_ID.toml b/web/translation/translate.id_ID.toml index 31469392..3ec374fb 100644 --- a/web/translation/translate.id_ID.toml +++ b/web/translation/translate.id_ID.toml @@ -549,6 +549,7 @@ "datetime" = "⏰ Tanggal & Waktu: {{ .DateTime }}\r\n" "hostname" = "💻 Host: {{ .Hostname }}\r\n" "version" = "🚀 Versi 3X-UI: {{ .Version }}\r\n" +"xrayVersion" = "📡 Versi Xray: {{ .XrayVersion }}\r\n" "ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n" "ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n" "ip" = "🌐 IP: {{ .IP }}\r\n" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index e1f19af8..7cd34698 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -549,6 +549,7 @@ "datetime" = "⏰ Дата и время: {{ .DateTime }}\r\n" "hostname" = "💻 Имя хоста: {{ .Hostname }}\r\n" "version" = "🚀 Версия X-UI: {{ .Version }}\r\n" +"xrayVersion" = "📡 Версия Xray: {{ .XrayVersion }}\r\n" "ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n" "ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n" "ip" = "🌐 IP: {{ .IP }}\r\n" diff --git a/web/translation/translate.uk_UA.toml b/web/translation/translate.uk_UA.toml index 5f724942..9fd4d429 100644 --- a/web/translation/translate.uk_UA.toml +++ b/web/translation/translate.uk_UA.toml @@ -549,6 +549,7 @@ "datetime" = "⏰ Дата й час: {{ .DateTime }}\r\n" "hostname" = "💻 Хост: {{ .Hostname }}\r\n" "version" = "🚀 3X-UI Версія: {{ .Version }}\r\n" +"xrayVersion" = "📡 Xray Версія: {{ .XrayVersion }}\r\n" "ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n" "ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n" "ip" = "🌐 IP: {{ .IP }}\r\n" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index 5b3a98d2..d8d73c64 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -549,6 +549,7 @@ "datetime" = "⏰ Ngày-Giờ: {{ .DateTime }}\r\n"
"hostname" = "💻 Tên máy chủ: {{ .Hostname }}\r\n"
"version" = "🚀 Phiên bản X-UI: {{ .Version }}\r\n"
+"xrayVersion" = "📡 Phiên bản Xray: {{ .XrayVersion }}\r\n"
"ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n"
"ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n"
"ip" = "🌐 IP: {{ .IP }}\r\n"
diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index b0831bd5..a1a1c8d7 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -549,6 +549,7 @@ "datetime" = "⏰ 日期时间:{{ .DateTime }}\r\n" "hostname" = "💻 主机名:{{ .Hostname }}\r\n" "version" = "🚀 X-UI 版本:{{ .Version }}\r\n" +"xrayVersion" = "📡 Xray 版本: {{ .XrayVersion }}\r\n" "ipv6" = "🌐 IPv6:{{ .IPv6 }}\r\n" "ipv4" = "🌐 IPv4:{{ .IPv4 }}\r\n" "ip" = "🌐 IP:{{ .IP }}\r\n" |
