Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-03-31 00:22:48 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-03-31 00:22:48 +0300
commitf2c28822c1ebef8a0143c4d05676286072dab996 (patch)
treeb1824471c83407ba12d9538dc828d211a3fd8f9c /web/html/xui/setting.html
parent48d6362a69be900a2ae52be6bdb3a7700420b44d (diff)
option - ban ir ip - ban ir domain
Diffstat (limited to 'web/html/xui/setting.html')
-rw-r--r--web/html/xui/setting.html71
1 files changed, 70 insertions, 1 deletions
diff --git a/web/html/xui/setting.html b/web/html/xui/setting.html
index 057dae95..7acab065 100644
--- a/web/html/xui/setting.html
+++ b/web/html/xui/setting.html
@@ -97,7 +97,9 @@
<a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'">
<setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigTorrent"}}' desc='{{ i18n "pages.setting.xrayConfigTorrentDesc"}}' v-model="torrentSettings"></setting-list-item>
<setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigPrivateIp"}}' desc='{{ i18n "pages.setting.xrayConfigPrivateIpDesc"}}' v-model="privateIpSettings"></setting-list-item>
- <a-divider>{{ i18n "pages.setting.advancedTemplate"}}</a-divider>
+ <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigIRIp"}}' desc='{{ i18n "pages.setting.xrayConfigIRIpDesc"}}' v-model="IRIpSettings"></setting-list-item>
+ <setting-list-item type="switch" title='{{ i18n "pages.setting.xrayConfigIRdomain"}}' desc='{{ i18n "pages.setting.xrayConfigIRdomainDesc"}}' v-model="IRdomainSettings"></setting-list-item>
+ <a-divider>{{ i18n "pages.setting.advancedTemplate"}}</a-divider>
<a-collapse>
<a-collapse-panel header="{{ i18n "pages.setting.xrayConfigInbounds"}}">
<setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigInbounds"}}' desc='{{ i18n "pages.setting.xrayConfigInboundsDesc"}}' v-model ="inboundSettings"></setting-list-item>
@@ -304,6 +306,73 @@
this.templateSettings = newTemplateSettings
},
},
+ IRIpSettings: {
+ get: function () {
+ localIpFilter = false
+ if(this.templateSettings != null){
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if(routingRule.hasOwnProperty("ip")){
+ if (routingRule.ip[0] === "geoip:ir" && routingRule.outboundTag == "blocked"){
+ localIpFilter = true
+ }
+ }
+ });
+ }
+ return localIpFilter
+ },
+ set: function (newValue) {
+ newTemplateSettings = JSON.parse(this.allSetting.xrayTemplateConfig);
+ if (newValue){
+ newTemplateSettings.routing.rules.push(JSON.parse("{\"outboundTag\": \"blocked\",\"ip\": [\"geoip:ir\"],\"type\": \"field\"}"))
+ }
+ else {
+ newTemplateSettings.routing.rules = [];
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if (routingRule.hasOwnProperty('ip')){
+ if (routingRule.ip[0] === "geoip:ir" && routingRule.outboundTag == "blocked"){
+ return;
+ }
+ }
+ newTemplateSettings.routing.rules.push(routingRule);
+ });
+ }
+ this.templateSettings = newTemplateSettings
+ },
+ },
+ IRdomainSettings: {
+ get: function () {
+ localdomainFilter = false
+ if(this.templateSettings != null){
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if(routingRule.hasOwnProperty("domain")){
+ if (routingRule.domain[0] === "regexp:.+.ir$" && routingRule.outboundTag == "blocked"){
+ localdomainFilter = true
+ }
+ }
+ });
+ }
+ return localdomainFilter
+ },
+ set: function (newValue) {
+ newTemplateSettings = JSON.parse(this.allSetting.xrayTemplateConfig);
+ if (newValue){
+ newTemplateSettings.routing.rules.push(JSON.parse("{\"outboundTag\": \"blocked\",\"domain\": [\"regexp:.+.ir$\"],\"type\": \"field\"}"))
+ }
+ else {
+ newTemplateSettings.routing.rules = [];
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if (routingRule.hasOwnProperty('domain')){
+ if (routingRule.domain[0] === "regexp:.+.ir$" && routingRule.outboundTag == "blocked"){
+ return;
+ }
+ }
+ newTemplateSettings.routing.rules.push(routingRule);
+ });
+ }
+ this.templateSettings = newTemplateSettings
+ },
+ },
+
}
});