From 7466916e0206d55826d74f37c251bb5e40182c00 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sun, 19 Apr 2026 22:24:24 +0300 Subject: Add custom geosite/geoip URL sources (#3980) * feat: add custom geosite/geoip URL sources Register DB model, panel API, index/xray UI, and i18n. * fix --- web/html/xray.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'web/html/xray.html') diff --git a/web/html/xray.html b/web/html/xray.html index 02243277..040ae2ee 100644 --- a/web/html/xray.html +++ b/web/html/xray.html @@ -259,6 +259,7 @@ refreshing: false, restartResult: '', showAlert: false, + customGeoAliasLabelSuffix: '{{ i18n "pages.index.customGeoAliasLabelSuffix" }}', advSettings: 'xraySetting', obsSettings: '', cm: null, @@ -1054,6 +1055,31 @@ }, showWarp() { warpModal.show(); + }, + async loadCustomGeoAliases() { + try { + const msg = await HttpUtil.get('/panel/api/custom-geo/aliases'); + if (!msg.success) { + console.warn('Failed to load custom geo aliases:', msg.msg || 'request failed'); + return; + } + if (!msg.obj) return; + const { geoip = [], geosite = [] } = msg.obj; + const geoSuffix = this.customGeoAliasLabelSuffix || ''; + geoip.forEach((x) => { + this.settingsData.IPsOptions.push({ + label: x.alias + geoSuffix, + value: x.extExample, + }); + }); + geosite.forEach((x) => { + const opt = { label: x.alias + geoSuffix, value: x.extExample }; + this.settingsData.DomainsOptions.push(opt); + this.settingsData.BlockDomainsOptions.push(opt); + }); + } catch (e) { + console.error('Failed to load custom geo aliases:', e); + } } }, async mounted() { @@ -1061,6 +1087,7 @@ this.showAlert = true; } await this.getXraySetting(); + await this.loadCustomGeoAliases(); await this.getXrayResult(); await this.getOutboundsTraffic(); -- cgit v1.2.3