diff options
| author | Vladislav Tupikin <MrRefactoring@yandex.ru> | 2026-04-19 22:24:24 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-19 22:24:24 +0300 |
| commit | 7466916e0206d55826d74f37c251bb5e40182c00 (patch) | |
| tree | 2c887558c71f34b76e541c7bf7d57a420ed3c9ed /web/html/xray.html | |
| parent | 96b568b8389fd5a3ce228d5fb82ec9742d145b15 (diff) | |
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
Diffstat (limited to 'web/html/xray.html')
| -rw-r--r-- | web/html/xray.html | 27 |
1 files changed, 27 insertions, 0 deletions
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(); |
