Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2024-01-21 14:09:15 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2024-01-21 14:09:15 +0300
commite7ce8c8ddb8472695b296eac305c5ac9b8c1d3d8 (patch)
tree4d2d3153d5ed585fbade011cfaca58175e5301e5 /web
parent4b9bbbc34b3ed5563f9cb14420b768d241580cf3 (diff)
minor changes
disAllowedIps doesn't show on debug if there is no ip change copy to clipboard to export inbound
Diffstat (limited to 'web')
-rw-r--r--web/html/xui/inbounds.html2
-rw-r--r--web/job/check_client_ip_job.go23
-rw-r--r--web/translation/translate.en_US.toml2
-rw-r--r--web/translation/translate.es_ES.toml2
-rw-r--r--web/translation/translate.fa_IR.toml2
-rw-r--r--web/translation/translate.ru_RU.toml2
-rw-r--r--web/translation/translate.vi_VN.toml2
-rw-r--r--web/translation/translate.zh_Hans.toml2
8 files changed, 21 insertions, 16 deletions
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 79326ca2..c986e3fd 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -230,7 +230,7 @@
</template>
<a-menu-item key="clipboard">
<a-icon type="copy"></a-icon>
- {{ i18n "pages.inbounds.copyToClipboard" }}
+ {{ i18n "pages.inbounds.exportInbound" }}
</a-menu-item>
<a-menu-item key="resetTraffic">
<a-icon type="retweet"></a-icon> {{ i18n "pages.inbounds.resetTraffic" }}
diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go
index 65257170..b393e68d 100644
--- a/web/job/check_client_ip_job.go
+++ b/web/job/check_client_ip_job.go
@@ -16,17 +16,18 @@ import (
"x-ui/xray"
)
-type CheckClientIpJob struct{}
+type CheckClientIpJob struct {
+ disAllowedIps []string
+}
var job *CheckClientIpJob
-var disAllowedIps []string
var ipFiles = []string{
xray.GetIPLimitLogPath(),
-xray.GetIPLimitPrevLogPath(),
+ xray.GetIPLimitPrevLogPath(),
xray.GetIPLimitBannedLogPath(),
-xray.GetIPLimitBannedPrevLogPath(),
+ xray.GetIPLimitBannedPrevLogPath(),
xray.GetAccessPersistentLogPath(),
-xray.GetAccessPersistentPrevLogPath(),
+ xray.GetAccessPersistentPrevLogPath(),
}
func NewCheckClientIpJob() *CheckClientIpJob {
@@ -130,7 +131,6 @@ func (j *CheckClientIpJob) processLogFile() {
}
}
- disAllowedIps = []string{}
shouldCleanLog := false
for clientEmail, ips := range InboundClientIps {
@@ -237,6 +237,7 @@ func (j *CheckClientIpJob) updateInboundClientIps(inboundClientIps *model.Inboun
json.Unmarshal([]byte(inbound.Settings), &settings)
clients := settings["clients"]
shouldCleanLog := false
+ j.disAllowedIps = []string{}
// create iplimit log file channel
logIpFile, err := os.OpenFile(xray.GetIPLimitLogPath(), os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644)
@@ -255,7 +256,7 @@ func (j *CheckClientIpJob) updateInboundClientIps(inboundClientIps *model.Inboun
shouldCleanLog = true
if limitIp < len(ips) && inbound.Enable {
- disAllowedIps = append(disAllowedIps, ips[limitIp:]...)
+ j.disAllowedIps = append(j.disAllowedIps, ips[limitIp:]...)
for i := limitIp; i < len(ips); i++ {
log.Printf("[LIMIT_IP] Email = %s || SRC = %s", clientEmail, ips[i])
}
@@ -263,8 +264,12 @@ func (j *CheckClientIpJob) updateInboundClientIps(inboundClientIps *model.Inboun
}
}
}
- logger.Debug("disAllowedIps ", disAllowedIps)
- sort.Strings(disAllowedIps)
+
+ sort.Strings(j.disAllowedIps)
+
+ if len(j.disAllowedIps) > 0 {
+ logger.Debug("disAllowedIps ", j.disAllowedIps)
+ }
db := database.GetDB()
err = db.Save(inboundClientIps).Error
diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml
index 2f1c0544..006378ab 100644
--- a/web/translation/translate.en_US.toml
+++ b/web/translation/translate.en_US.toml
@@ -178,7 +178,7 @@
"info" = "Info"
"same" = "Same"
"inboundData" = "Inbound's Data"
-"copyToClipboard" = "Copy to Clipboard"
+"exportInbound" = "Export Inbound"
"import" = "Import"
"importInbound" = "Import an Inbound"
diff --git a/web/translation/translate.es_ES.toml b/web/translation/translate.es_ES.toml
index 42a3a2b2..bbf50b6c 100644
--- a/web/translation/translate.es_ES.toml
+++ b/web/translation/translate.es_ES.toml
@@ -178,7 +178,7 @@
"info" = "Info"
"same" = "misma"
"inboundData" = "Datos de entrada"
-"copyToClipboard" = "Copiar al portapapeles"
+"exportInbound" = "Exportación entrante"
"import" = "Importar"
"importInbound" = "Importar un entrante"
diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml
index 3edcb4cb..1de8538c 100644
--- a/web/translation/translate.fa_IR.toml
+++ b/web/translation/translate.fa_IR.toml
@@ -178,7 +178,7 @@
"info" = "اطلاعات"
"same" = "همسان"
"inboundData" = "داده‌های ورودی"
-"copyToClipboard" = "کپی در حافظه"
+"exportInbound" = "استخراج ورودی"
"import" = "افزودن"
"importInbound" = "افزودن یک ورودی"
diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml
index d8211d8d..2f33311e 100644
--- a/web/translation/translate.ru_RU.toml
+++ b/web/translation/translate.ru_RU.toml
@@ -178,7 +178,7 @@
"info" = "Информация"
"same" = "Тот же"
"inboundData" = "Входящие данные"
-"copyToClipboard" = "Копировать в буфер обмена"
+"exportInbound" = "Экспорт входящих"
"import" = "Импортировать"
"importInbound" = "Импортировать входящее сообщение"
diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml
index 7491a70c..1a2cfaa0 100644
--- a/web/translation/translate.vi_VN.toml
+++ b/web/translation/translate.vi_VN.toml
@@ -178,7 +178,7 @@
"info" = "Thông tin"
"same" = "Giống nhau"
"inboundData" = "Dữ liệu gửi đến"
-"copyToClipboard" = "Sao chép vào bảng nhớ tạm"
+"exportInbound" = "Xuất nhập khẩu"
"import" = "Nhập"
"importInbound" = "Nhập inbound"
diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml
index 5a46ec73..966ef3f7 100644
--- a/web/translation/translate.zh_Hans.toml
+++ b/web/translation/translate.zh_Hans.toml
@@ -178,7 +178,7 @@
"info" = "信息"
"same" = "相同"
"inboundData" = "入站数据"
-"copyToClipboard" = "复制到剪贴板"
+"exportInbound" = "出口 入境"
"import"="导入"
"importInbound" = "导入入站"