diff options
| author | Ho3ein <ho3ein.sanaei@gmail.com> | 2023-03-31 01:46:40 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-31 01:46:40 +0300 |
| commit | ef24174a38126ec521249ca093c43fa32edd2523 (patch) | |
| tree | b1824471c83407ba12d9538dc828d211a3fd8f9c /web/html | |
| parent | 706c39452b0753802792e2498a513e503e97283b (diff) | |
| parent | f2c28822c1ebef8a0143c4d05676286072dab996 (diff) | |
Merge pull request #132 from MHSanaei/master
Master
Diffstat (limited to 'web/html')
| -rw-r--r-- | web/html/xui/form/protocol/dokodemo.html | 6 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/shadowsocks.html | 10 | ||||
| -rw-r--r-- | web/html/xui/setting.html | 71 |
3 files changed, 78 insertions, 9 deletions
diff --git a/web/html/xui/form/protocol/dokodemo.html b/web/html/xui/form/protocol/dokodemo.html index dbba6b5b..53c82c3c 100644 --- a/web/html/xui/form/protocol/dokodemo.html +++ b/web/html/xui/form/protocol/dokodemo.html @@ -8,9 +8,9 @@ </a-form-item> <a-form-item label='{{ i18n "pages.inbounds.network"}}'> <a-select v-model="inbound.settings.network" style="width: 100px;" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"> - <a-select-option value="tcp,udp">tcp+udp</a-select-option> - <a-select-option value="tcp">tcp</a-select-option> - <a-select-option value="udp">udp</a-select-option> + <a-select-option value="tcp,udp">TCP+UDP</a-select-option> + <a-select-option value="tcp">TCP</a-select-option> + <a-select-option value="udp">UDP</a-select-option> </a-select> </a-form-item> <a-form-item label="FollowRedirect"> diff --git a/web/html/xui/form/protocol/shadowsocks.html b/web/html/xui/form/protocol/shadowsocks.html index 21d614ae..718ba894 100644 --- a/web/html/xui/form/protocol/shadowsocks.html +++ b/web/html/xui/form/protocol/shadowsocks.html @@ -1,18 +1,18 @@ {{define "form/shadowsocks"}} <a-form layout="inline"> <a-form-item label='{{ i18n "encryption" }}'> - <a-select v-model="inbound.settings.method" style="width: 165px;" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"> + <a-select v-model="inbound.settings.method" style="width: 250px;" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"> <a-select-option v-for="method in SSMethods" :value="method">[[ method ]]</a-select-option> </a-select> </a-form-item> <a-form-item label='{{ i18n "password" }}'> - <a-input v-model.trim="inbound.settings.password"></a-input> + <a-input v-model.trim="inbound.settings.password" style="width: 250px;"></a-input> </a-form-item> <a-form-item label='{{ i18n "pages.inbounds.network" }}'> <a-select v-model="inbound.settings.network" style="width: 100px;" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"> - <a-select-option value="tcp,udp">tcp+udp</a-select-option> - <a-select-option value="tcp">tcp</a-select-option> - <a-select-option value="udp">udp</a-select-option> + <a-select-option value="tcp,udp">TCP+UDP</a-select-option> + <a-select-option value="tcp">TCP</a-select-option> + <a-select-option value="udp">UDP</a-select-option> </a-select> </a-form-item> </a-form> 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 + }, + }, + } }); |
