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:
Diffstat (limited to 'web/html/xui/setting.html')
-rw-r--r--web/html/xui/setting.html120
1 files changed, 118 insertions, 2 deletions
diff --git a/web/html/xui/setting.html b/web/html/xui/setting.html
index cbbdce1f..17f76cb0 100644
--- a/web/html/xui/setting.html
+++ b/web/html/xui/setting.html
@@ -20,7 +20,7 @@
display: block;
}
- :not(.ant-card-dark)>.ant-tabs-top-bar {
+ :not(.ant-card-dark)>.ant-tabs-top-bar {
background: white;
}
</style>
@@ -56,6 +56,7 @@
ref="selectLang"
v-model="lang"
@change="setLang(lang)"
+ :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"
style="width: 100%"
>
<a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
@@ -87,13 +88,28 @@
style="max-width: 300px"></a-input>
</a-form-item>
<a-form-item>
-<!-- <a-button type="primary" @click="updateUser">update</a-button>-->
+<!-- <a-button type="primary" @click="updateUser">Revise</a-button>-->
<a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button>
</a-form-item>
</a-form>
</a-tab-pane>
<a-tab-pane key="3" tab='{{ i18n "pages.setting.xrayConfiguration"}}'>
<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>
+ <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>
+ </a-collapse-panel>
+ <a-collapse-panel header="{{ i18n "pages.setting.xrayConfigOutbounds"}}">
+ <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigOutbounds"}}' desc='{{ i18n "pages.setting.xrayConfigOutboundsDesc"}}' v-model ="outboundSettings"></setting-list-item>
+ </a-collapse-panel>
+ <a-collapse-panel header="{{ i18n "pages.setting.xrayConfigRoutings"}}">
+ <setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigRoutings"}}' desc='{{ i18n "pages.setting.xrayConfigRoutingsDesc"}}' v-model ="routingRuleSettings"></setting-list-item>
+ </a-collapse-panel>
+ </a-collapse>
+ <a-divider>{{ i18n "pages.setting.completeTemplate"}}</a-divider>
<setting-list-item type="textarea" title='{{ i18n "pages.setting.xrayConfigTemplate"}}' desc='{{ i18n "pages.setting.xrayConfigTemplateDesc"}}' v-model="allSetting.xrayTemplateConfig"></setting-list-item>
</a-list>
</a-tab-pane>
@@ -103,6 +119,10 @@
<setting-list-item type="text" title='{{ i18n "pages.setting.telegramToken"}}' desc='{{ i18n "pages.setting.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item>
<setting-list-item type="number" title='{{ i18n "pages.setting.telegramChatId"}}' desc='{{ i18n "pages.setting.telegramChatIdDesc"}}' v-model.number="allSetting.tgBotChatId"></setting-list-item>
<setting-list-item type="text" title='{{ i18n "pages.setting.telegramNotifyTime"}}' desc='{{ i18n "pages.setting.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item>
+ <setting-list-item type="switch" title='{{ i18n "pages.setting.tgNotifyBackup" }}' desc='{{ i18n "pages.setting.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item>
+ <setting-list-item type="number" title='{{ i18n "pages.setting.tgNotifyExpireTimeDiff" }}' desc='{{ i18n "pages.setting.tgNotifyExpireTimeDiffDesc" }}' v-model="allSetting.tgExpireDiff" :min="0"></setting-list-item>
+ <setting-list-item type="number" title='{{ i18n "pages.setting.tgNotifyTrafficDiff" }}' desc='{{ i18n "pages.setting.tgNotifyTrafficDiffDesc" }}' v-model="allSetting.tgTrafficDiff" :min="0"></setting-list-item>
+ <setting-list-item type="number" title='{{ i18n "pages.setting.tgNotifyCpu" }}' desc='{{ i18n "pages.setting.tgNotifyCpuDesc" }}' v-model="allSetting.tgCpu" :min="0" :max="100"></setting-list-item>
</a-list>
</a-tab-pane>
<a-tab-pane key="5" tab='{{ i18n "pages.setting.otherSetting"}}'>
@@ -189,6 +209,102 @@
this.saveBtnDisable = this.oldAllSetting.equals(this.allSetting);
}
},
+ computed: {
+ templateSettings: {
+ get: function () { return this.allSetting.xrayTemplateConfig ? JSON.parse(this.allSetting.xrayTemplateConfig) : null ; },
+ set: function (newValue) { this.allSetting.xrayTemplateConfig = JSON.stringify(newValue, null, 2) },
+ },
+ inboundSettings: {
+ get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; },
+ set: function (newValue) {
+ newTemplateSettings = this.templateSettings;
+ newTemplateSettings.inbounds = JSON.parse(newValue)
+ this.templateSettings = newTemplateSettings
+ },
+ },
+ outboundSettings: {
+ get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.outbounds, null, 2) : null; },
+ set: function (newValue) {
+ newTemplateSettings = this.templateSettings;
+ newTemplateSettings.outbounds = JSON.parse(newValue)
+ this.templateSettings = newTemplateSettings
+ },
+ },
+ routingRuleSettings: {
+ get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.routing.rules, null, 2) : null; },
+ set: function (newValue) {
+ newTemplateSettings = this.templateSettings;
+ newTemplateSettings.routing.rules = JSON.parse(newValue)
+ this.templateSettings = newTemplateSettings
+ },
+ },
+ torrentSettings: {
+ get: function () {
+ torrentFilter = false
+ if(this.templateSettings != null){
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if(routingRule.hasOwnProperty("protocol")){
+ if (routingRule.protocol[0] === "bittorrent" && routingRule.outboundTag == "blocked"){
+ torrentFilter = true
+ }
+ }
+ });
+ }
+ return torrentFilter
+ },
+ set: function (newValue) {
+ newTemplateSettings = JSON.parse(this.allSetting.xrayTemplateConfig);
+ if (newValue){
+ newTemplateSettings.routing.rules.push(JSON.parse("{\"outboundTag\": \"blocked\",\"protocol\": [\"bittorrent\"],\"type\": \"field\"}"))
+ }
+ else {
+ newTemplateSettings.routing.rules = [];
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if (routingRule.hasOwnProperty('protocol')){
+ if (routingRule.protocol[0] === "bittorrent" && routingRule.outboundTag == "blocked"){
+ return;
+ }
+ }
+ newTemplateSettings.routing.rules.push(routingRule);
+ });
+ }
+ this.templateSettings = newTemplateSettings
+ },
+ },
+ privateIpSettings: {
+ get: function () {
+ localIpFilter = false
+ if(this.templateSettings != null){
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if(routingRule.hasOwnProperty("ip")){
+ if (routingRule.ip[0] === "geoip:private" && 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:private\"],\"type\": \"field\"}"))
+ }
+ else {
+ newTemplateSettings.routing.rules = [];
+ this.templateSettings.routing.rules.forEach(routingRule => {
+ if (routingRule.hasOwnProperty('ip')){
+ if (routingRule.ip[0] === "geoip:private" && routingRule.outboundTag == "blocked"){
+ return;
+ }
+ }
+ newTemplateSettings.routing.rules.push(routingRule);
+ });
+ }
+ this.templateSettings = newTemplateSettings
+ },
+ },
+ }
});
</script>