diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 9dce8982..1cd1be1a 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -1195,35 +1195,48 @@ } }, getSubGroupClients(dbInbounds, currentClient) { - const response = { - inbounds: [], - clients: [], - editIds: [] + const response = { + inbounds: [], + clients: [], + editIds: [], + }; + + if (!Array.isArray(dbInbounds) || dbInbounds.length === 0) { + return response; + } + if (!currentClient || !currentClient.subId) { + return response; + } + + dbInbounds.forEach((dbInboundItem) => { + try { + const dbInbound = new DBInbound(dbInboundItem); + if (!dbInbound) { + return; } - if (dbInbounds && dbInbounds.length > 0 && currentClient) { - dbInbounds.forEach((dbInboundItem) => { - const dbInbound = new DBInbound(dbInboundItem); - if (dbInbound) { - const inbound = dbInbound.toInbound(); - if (inbound) { - const clients = inbound.clients; - if (clients.length > 0) { - clients.forEach((client) => { - if (client['subId'] === currentClient['subId']) { - client['inboundId'] = dbInboundItem.id - client['clientId'] = this.getClientId(dbInbound.protocol, client) - response.inbounds.push(dbInboundItem.id) - response.clients.push(client) - response.editIds.push(client['clientId']) - } - }) - } - } - } - }) + + const inbound = dbInbound.toInbound(); + if (!inbound || !Array.isArray(inbound.clients)) { + return; } - return response; - }, + + inbound.clients.forEach((client) => { + if (client.subId === currentClient.subId) { + client.inboundId = dbInboundItem.id; + client.clientId = this.getClientId(dbInbound.protocol, client); + + response.inbounds.push(dbInboundItem.id); + response.clients.push(client); + response.editIds.push(client.clientId); + } + }); + } catch (error) { + console.error("Error processing dbInboundItem:", dbInboundItem, error); + } + }); + + return response; + }, getClientId(protocol, client) { switch (protocol) { case Protocols.TROJAN: return client.password; diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index cc3e1239..3f15c7ba 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -143,6 +143,7 @@ + @@ -1823,6 +1824,18 @@ this.templateSettings = newTemplateSettings; } }, + outboundTraffic: { + get: function () { + if (!this.templateSettings || !this.templateSettings.policy.system || !this.templateSettings.policy.system.statsOutboundDownlink) return false; + return this.templateSettings.policy.system.statsOutboundDownlink; + }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.policy.system.statsOutboundDownlink = newValue; + newTemplateSettings.policy.system.statsOutboundUplink = newValue; + this.templateSettings = newTemplateSettings; + } + }, maskAddressLog: { get: function () { if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.maskAddress) return ""; diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 637c9d1b..85f0c07b 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "The file path for the error log. The special value 'none' disabled error logs" "dnsLog" = "DNS Log" "dnsLogDesc" = "Whether to enable DNS query logs" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "Mask Address" "maskAddressDesc" = "IP address mask, when enabled, will automatically replace the IP address that appears in the log." diff --git a/web/translation/translate.es_ES.toml b/web/translation/translate.es_ES.toml index 6ef70309..9e591253 100644 --- a/web/translation/translate.es_ES.toml +++ b/web/translation/translate.es_ES.toml @@ -371,6 +371,8 @@ "errorLogDesc" = "La ruta del archivo para el registro de errores. El valor especial 'none' desactiva los registros de errores." "dnsLog" = "Registro DNS" "dnsLogDesc" = "Si habilitar los registros de consulta DNS" +"outBoundTraffic" = "Tráfico saliente" +"outBoundTrafficDesc" = "Si se debe habilitar el tráfico saliente" "maskAddress" = "Enmascarar Dirección" "maskAddressDesc" = "Máscara de dirección IP, cuando se habilita, reemplazará automáticamente la dirección IP que aparece en el registro." diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index 2d05bc5b..9fb66f56 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "مسیر فایل برای ورود به سیستم خطا. مقدار ویژه «هیچ» گزارش های خطا را غیرفعال میکند" "dnsLog" = "گزارش DNS" "dnsLogDesc" = "آیا ثبت‌های درخواست DNS را فعال کنید" +"outBoundTraffic" = "ترافیک خروجی" +"outBoundTrafficDesc" = "فعال کردن ترافیک خروجی" "maskAddress" = "پنهان کردن آدرس" "maskAddressDesc" = "پوشش آدرس IP، هنگامی که فعال می‌شود، به طور خودکار آدرس IP که در لاگ ظاهر می‌شود را جایگزین می‌کند." diff --git a/web/translation/translate.id_ID.toml b/web/translation/translate.id_ID.toml index f1e2586a..ab8415f9 100644 --- a/web/translation/translate.id_ID.toml +++ b/web/translation/translate.id_ID.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "Jalur file untuk log kesalahan. Nilai khusus 'tidak ada' menonaktifkan log kesalahan" "dnsLog" = "Log DNS" "dnsLogDesc" = "Apakah akan mengaktifkan log kueri DNS" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "Alamat Masker" "maskAddressDesc" = "Masker alamat IP, ketika diaktifkan, akan secara otomatis mengganti alamat IP yang muncul di log." diff --git a/web/translation/translate.ja_JP.toml b/web/translation/translate.ja_JP.toml index 72043cef..ec5c85f6 100644 --- a/web/translation/translate.ja_JP.toml +++ b/web/translation/translate.ja_JP.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "エラーログのファイルパス。特殊値 'none' はエラーログを無効にします" "dnsLog" = "DNS ログ" "dnsLogDesc" = "DNSクエリのログを有効にするかどうか" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "アドレスをマスク" "maskAddressDesc" = "IPアドレスをマスクし、有効にするとログに表示されるIPアドレスを自動的に置き換えます" diff --git a/web/translation/translate.pt_BR.toml b/web/translation/translate.pt_BR.toml index 5699a4cf..fcef4429 100644 --- a/web/translation/translate.pt_BR.toml +++ b/web/translation/translate.pt_BR.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "O caminho do arquivo para o log de erros. O valor especial 'none' desativa os logs de erro." "dnsLog" = "Log DNS" "dnsLogDesc" = "Se ativar logs de consulta DNS" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "Mascarar Endereço" "maskAddressDesc" = "Máscara de endereço IP, quando ativado, substitui automaticamente o endereço IP que aparece no log." diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 19f040df..6a9df0e8 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "Путь к файлу журнала ошибок. Специальное значение «none» отключает журналы ошибок." "dnsLog" = "DNS Журнал" "dnsLogDesc" = "Включить логи запросов DNS" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "Маскировать Адрес" "maskAddressDesc" = "Маска IP-адреса, при активации автоматически заменяет IP-адрес, который появляется в логе." diff --git a/web/translation/translate.tr_TR.toml b/web/translation/translate.tr_TR.toml index 43de7d39..ad36734e 100644 --- a/web/translation/translate.tr_TR.toml +++ b/web/translation/translate.tr_TR.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "Hata günlüğü için dosya yolu. 'none' özel değeri hata günlüklerini devre dışı bırakır" "dnsLog" = "DNS Günlüğü" "dnsLogDesc" = "DNS sorgu günlüklerini etkinleştirin" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "Adres Maskesi" "maskAddressDesc" = "IP adresi maskesi, etkinleştirildiğinde, günlükte görünen IP adresini otomatik olarak değiştirecektir." diff --git a/web/translation/translate.uk_UA.toml b/web/translation/translate.uk_UA.toml index 53373dd0..8ea46549 100644 --- a/web/translation/translate.uk_UA.toml +++ b/web/translation/translate.uk_UA.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "Шлях до файлу журналу помилок. Спеціальне значення 'none' вимикає журнали помилок" "dnsLog" = "Журнал DNS" "dnsLogDesc" = "Чи включити журнали запитів DNS" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "Маскувати Адресу" "maskAddressDesc" = "Маска IP-адреси, при активації автоматично замінює IP-адресу, яка з'являється у журналі." diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index 8130929d..cdc6b1e4 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "Đường dẫn tệp cho nhật ký lỗi. Nhật ký lỗi bị vô hiệu hóa có giá trị đặc biệt 'không'" "dnsLog" = "Nhật ký DNS" "dnsLogDesc" = "Có bật nhật ký truy vấn DNS không" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "Ẩn Địa Chỉ" "maskAddressDesc" = "Mặt nạ địa chỉ IP, khi được bật, sẽ tự động thay thế địa chỉ IP xuất hiện trong nhật ký." diff --git a/web/translation/translate.zh_CN.toml b/web/translation/translate.zh_CN.toml index beddd1e6..2ce88cf7 100644 --- a/web/translation/translate.zh_CN.toml +++ b/web/translation/translate.zh_CN.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "错误日志的文件路径。特殊值 'none' 禁用错误日志" "dnsLog" = "DNS 日志" "dnsLogDesc" = "是否启用 DNS 查询日志" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "隐藏地址" "maskAddressDesc" = "IP 地址掩码,启用时会自动替换日志中出现的 IP 地址。" diff --git a/web/translation/translate.zh_TW.toml b/web/translation/translate.zh_TW.toml index 7ce4103a..da5eb57f 100644 --- a/web/translation/translate.zh_TW.toml +++ b/web/translation/translate.zh_TW.toml @@ -373,6 +373,8 @@ "errorLogDesc" = "錯誤日誌的檔案路徑。特殊值 'none' 禁用錯誤日誌" "dnsLog" = "DNS 日誌" "dnsLogDesc" = "是否啟用 DNS 查詢日誌" +"outBoundTraffic" = "Outbounds Traffic" +"outBoundTrafficDesc" = "Whether to enable outbound traffic" "maskAddress" = "隱藏地址" "maskAddressDesc" = "IP 地址掩碼,啟用時會自動替換日誌中出現的 IP 地址。"