feat(online): use xray online-stats API for onlines and access-log-free IP limit

Adopt xray-core's statsUserOnline policy and GetUsersStats RPC so online
detection is connection-based and IP limiting no longer requires an access
log. Falls back to the legacy traffic-delta onlines and access-log parsing
when the running core lacks the RPCs (Unimplemented), probed lazily per
process so a panel-driven version switch re-evaluates automatically.

Backend:
- xray/api.go: GetOnlineUsers (one GetUsersStats call returns all online
  users and their source IPs) and IsUnimplementedErr.
- xray/process.go: per-process OnlineAPISupport tri-state capability cache.
- service/xray.go: ensureStatsPolicy injects statsUserOnline into every
  policy level of the generated config; XrayService.GetOnlineUsers probes
  and falls back.
- job/xray_traffic_job.go: union API onlines into the delta-derived active
  set; bump last_online for idle-but-connected clients.
- job/check_client_ip_job.go: API-first IP source with shared enforcement;
  live observations bypass the 30-min stale cutoff; access-log path
  unchanged for older cores.
- service/setting.go: GetIpLimitEnable always true; new accessLogEnable
  default for features that genuinely read the access log.

Frontend:
- Client form split into Basic and Config tabs; IP Limit and IP Log no
  longer gated on access log; compact Auto Renew next to Start After First
  Use; tabBasic/tabConfig added to all 13 locales.
- Xray logs button on the dashboard now gated on accessLogEnable.
This commit is contained in:
MHSanaei
2026-06-11 19:42:03 +02:00
parent 58905d81a4
commit 7bcc5830c6
33 changed files with 790 additions and 285 deletions
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "أساسي",
"tabConfig": "التكوين",
"add": "إضافة عميل",
"edit": "تعديل العميل",
"submitAdd": "إضافة عميل",
+2
View File
@@ -628,6 +628,8 @@
}
},
"clients": {
"tabBasic": "Basic",
"tabConfig": "Config",
"add": "Add Client",
"edit": "Edit Client",
"submitAdd": "Add Client",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "Básico",
"tabConfig": "Configuración",
"add": "Añadir cliente",
"edit": "Editar cliente",
"submitAdd": "Añadir cliente",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "پایه",
"tabConfig": "پیکربندی",
"add": "افزودن کلاینت",
"edit": "ویرایش کلاینت",
"submitAdd": "افزودن کلاینت",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "Dasar",
"tabConfig": "Konfigurasi",
"add": "Tambah klien",
"edit": "Ubah klien",
"submitAdd": "Tambah klien",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "基本",
"tabConfig": "設定",
"add": "クライアントを追加",
"edit": "クライアントを編集",
"submitAdd": "クライアントを追加",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "Básico",
"tabConfig": "Configuração",
"add": "Adicionar cliente",
"edit": "Editar cliente",
"submitAdd": "Adicionar cliente",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "Основные",
"tabConfig": "Конфигурация",
"add": "Добавить клиента",
"edit": "Изменить клиента",
"submitAdd": "Добавить клиента",
+2
View File
@@ -628,6 +628,8 @@
}
},
"clients": {
"tabBasic": "Temel",
"tabConfig": "Yapılandırma",
"add": "Kullanıcı Ekle",
"edit": "Kullanıcıyı Düzenle",
"submitAdd": "Kullanıcı Ekle",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "Основні",
"tabConfig": "Конфігурація",
"add": "Додати клієнта",
"edit": "Редагувати клієнта",
"submitAdd": "Додати клієнта",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "Cơ bản",
"tabConfig": "Cấu hình",
"add": "Thêm khách hàng",
"edit": "Chỉnh sửa khách hàng",
"submitAdd": "Thêm khách hàng",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "基本",
"tabConfig": "配置",
"add": "添加客户端",
"edit": "编辑客户端",
"submitAdd": "添加客户端",
+2
View File
@@ -627,6 +627,8 @@
}
},
"clients": {
"tabBasic": "基本",
"tabConfig": "配置",
"add": "新增客戶端",
"edit": "編輯客戶端",
"submitAdd": "新增客戶端",