diff options
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(); |
