diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index 6baa63cf..e6f4cb52 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -692,6 +692,52 @@ + + + + @@ -716,6 +762,7 @@ {{template "balancerModal"}} {{template "dnsModal"}} {{template "fakednsModal"}} +{{template "geodataAssetModal"}} {{template "warpModal"}} +{{end}} diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index d0fa9c6d..495d460e 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -660,6 +660,19 @@ "ipPool" = "IP Pool Subnet" "poolSize" = "Pool Size" +[pages.xray.geodata] +"title" = "GeoData" +"enable" = "Enable GeoData" +"enableDesc" = "Reload geodata files on a schedule and download new .dat files before reloading." +"cron" = "Cron Schedule" +"cronDesc" = "5-field cron expression in local time, e.g. 0 4 * * * for daily at 04:00. Leave empty to disable the schedule." +"outbound" = "Download Outbound" +"outboundDesc" = "Outbound tag used when downloading geodata. Empty means routing decides the path." +"addAsset" = "Add Asset" +"editAsset" = "Edit Asset" +"url" = "URL" +"file" = "File" + [tgbot] "noResult" = "❗ No result!" "wentWrong" = "❌ Something went wrong!" diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index 471fff55..f98f200e 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -660,6 +660,19 @@ "ipPool" = "زیرشبکه استخر آی‌پی" "poolSize" = "اندازه استخر" +[pages.xray.geodata] +"title" = "GeoData" +"enable" = "فعال‌سازی GeoData" +"enableDesc" = "بارگذاری مجدد فایل‌های geodata طبق زمان‌بندی و دانلود فایل‌های .dat جدید قبل از reload." +"cron" = "زمان‌بندی Cron" +"cronDesc" = "عبارت cron پنج‌فیلدی بر اساس زمان محلی، مثلاً 0 4 * * * برای هر روز ساعت ۴. خالی = بدون زمان‌بندی." +"outbound" = "خروجی دانلود" +"outboundDesc" = "برچسب outbound برای دانلود geodata. خالی یعنی مسیریابی مسیر را تعیین می‌کند." +"addAsset" = "افزودن فایل" +"editAsset" = "ویرایش فایل" +"url" = "آدرس" +"file" = "نام فایل" + [tgbot] "noResult" = "❗نتیجه‌ای یافت نشد" "wentWrong" = "❌ مشکلی رخ داده‌است" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 70ba0a94..c88984fb 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -660,6 +660,19 @@ "ipPool" = "Подсеть пула IP" "poolSize" = "Размер пула" +[pages.xray.geodata] +"title" = "GeoData" +"enable" = "Включить GeoData" +"enableDesc" = "Перезагружать geodata по расписанию и скачивать новые .dat файлы перед перезагрузкой." +"cron" = "Расписание Cron" +"cronDesc" = "5-полевое cron-выражение в локальном времени, например 0 4 * * * для ежедневного запуска в 04:00. Пусто — без расписания." +"outbound" = "Исходящий для загрузки" +"outboundDesc" = "Тег исходящего для загрузки geodata. Пусто — маршрутизация выбирает путь." +"addAsset" = "Добавить ресурс" +"editAsset" = "Редактировать ресурс" +"url" = "URL" +"file" = "Файл" + [tgbot] "noResult" = "❗ Нет результатов!" "wentWrong" = "❌ Что-то пошло не так!" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index 0ce8cd33..e6b0ca0a 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -660,6 +660,19 @@ "ipPool" = "Mạng con nhóm IP" "poolSize" = "Kích thước bể bơi" +[pages.xray.geodata] +"title" = "GeoData" +"enable" = "Bật GeoData" +"enableDesc" = "Tải lại tệp geodata theo lịch và tải xuống tệp .dat mới trước khi reload." +"cron" = "Lịch Cron" +"cronDesc" = "Biểu thức cron 5 trường theo giờ địa phương, ví dụ 0 4 * * * chạy hàng ngày lúc 04:00. Để trống để tắt lịch." +"outbound" = "Outbound tải xuống" +"outboundDesc" = "Thẻ outbound dùng khi tải geodata. Để trống thì routing quyết định đường đi." +"addAsset" = "Thêm tài nguyên" +"editAsset" = "Sửa tài nguyên" +"url" = "URL" +"file" = "Tệp" + [tgbot] "noResult" = "❗ Không có kết quả!" "wentWrong" = "❌ Đã xảy ra lỗi!" diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index d679298a..476c937a 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -660,6 +660,19 @@ "ipPool" = "IP 池子网" "poolSize" = "池大小" +[pages.xray.geodata] +"title" = "GeoData" +"enable" = "启用 GeoData" +"enableDesc" = "按计划重新加载 geodata 文件,并在重新加载前下载新的 .dat 文件。" +"cron" = "Cron 计划" +"cronDesc" = "本地时间的 5 字段 cron 表达式,例如 0 4 * * * 表示每天 04:00。留空则禁用计划任务。" +"outbound" = "下载出站" +"outboundDesc" = "下载 geodata 时使用的出站标签。留空则由路由决定路径。" +"addAsset" = "添加资源" +"editAsset" = "编辑资源" +"url" = "URL" +"file" = "文件" + [tgbot] "noResult" = "❗ 没有结果!" "wentWrong" = "❌ 出了点问题!" diff --git a/xray/config.go b/xray/config.go index d91d96b8..01c8bc48 100644 --- a/xray/config.go +++ b/xray/config.go @@ -19,7 +19,8 @@ type Config struct { FakeDNS json_util.RawMessage `json:"fakedns"` Observatory json_util.RawMessage `json:"observatory"` BurstObservatory json_util.RawMessage `json:"burstObservatory"` - Metrics json_util.RawMessage `json:"metrics"` + Metrics json_util.RawMessage `json:"metrics,omitEmpty"` + GeoData json_util.RawMessage `json:"geodata,omitempty"` } func (c *Config) Equals(other *Config) bool { @@ -55,14 +56,20 @@ func (c *Config) Equals(other *Config) bool { if !bytes.Equal(c.Stats, other.Stats) { return false } - if !bytes.Equal(c.Reverse, other.Reverse) { + if !bytes.Equal(c.FakeDNS, other.FakeDNS) { return false } - if !bytes.Equal(c.FakeDNS, other.FakeDNS) { + if !bytes.Equal(c.Observatory, other.Observatory) { + return false + } + if !bytes.Equal(c.BurstObservatory, other.BurstObservatory) { return false } if !bytes.Equal(c.Metrics, other.Metrics) { return false } + if !bytes.Equal(c.GeoData, other.GeoData) { + return false + } return true }