diff options
Diffstat (limited to 'web/html/xui')
| -rw-r--r-- | web/html/xui/form/tls_settings.html | 6 | ||||
| -rw-r--r-- | web/html/xui/inbounds.html | 8 | ||||
| -rw-r--r-- | web/html/xui/settings.html | 236 |
3 files changed, 146 insertions, 104 deletions
diff --git a/web/html/xui/form/tls_settings.html b/web/html/xui/form/tls_settings.html index 91642727..35f101ca 100644 --- a/web/html/xui/form/tls_settings.html +++ b/web/html/xui/form/tls_settings.html @@ -10,7 +10,7 @@ Reality <a-tooltip> <template slot="title"> - <span>{{ i18n "pages.inbounds.realityDesc" }}</span> + <span>{{ i18n "pages.inbounds.realityDesc" }}</span> </template> <a-icon type="question-circle" theme="filled"></a-icon> </a-tooltip> @@ -22,7 +22,7 @@ XTLS <a-tooltip> <template slot="title"> - <span>{{ i18n "pages.inbounds.xtlsDesc" }}</span> + <span>{{ i18n "pages.inbounds.xtlsDesc" }}</span> </template> <a-icon type="question-circle" theme="filled"></a-icon> </a-tooltip> @@ -100,7 +100,7 @@ </a-form> <!-- xtls settings --> -<a-form v-if="inbound.xtls" layout="inline"> +<a-form v-else-if="inbound.xtls" layout="inline"> <a-form-item label='{{ i18n "domainName" }}'> <a-input v-model.trim="inbound.stream.xtls.server"></a-input> </a-form-item> diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 6fdf0c43..a66e84a9 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -105,6 +105,10 @@ </a-col> </a-row> </div> + <a-switch v-model="enableFilter" + checked-children='{{ i18n "search" }}' un-checked-children='{{ i18n "filter" }}' + @change="toggleFilter" style="margin-right: 10px;"> + </a-switch> <a-input v-if="!enableFilter" v-model.lazy="searchKey" placeholder='{{ i18n "search" }}' autofocus style="max-width: 300px"></a-input> <a-radio-group v-if="enableFilter" v-model="filterBy" @change="filterInbounds" button-style="solid"> <a-radio-button value="">{{ i18n "none" }}</a-radio-button> @@ -112,10 +116,6 @@ <a-radio-button value="depleted">{{ i18n "depleted" }}</a-radio-button> <a-radio-button value="expiring">{{ i18n "depletingSoon" }}</a-radio-button> </a-radio-group> - <a-switch v-model="enableFilter" - checked-children='{{ i18n "search" }}' un-checked-children='{{ i18n "filter" }}' - @change="toggleFilter"> - </a-switch> <a-table :columns="columns" :row-key="dbInbound => dbInbound.id" :data-source="searchedInbounds" :loading="spinning" :scroll="{ x: 1300 }" diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 3dd1f57b..f5ea4994 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -23,6 +23,34 @@ :not(.ant-card-dark)>.ant-tabs-top-bar { background: white; } + + .alert-msg { + color: rgb(194, 117, 18); + font-weight: bold; + font-size: 20px; + margin-top: 5px; + padding: 16px 6px; + text-align: center; + border-bottom: 1px solid; + } + + .alert-msg > i { + color: inherit; + font-size: 24px; + } + + .collapse-title { + color: inherit; + font-weight: bold; + font-size: 18px; + padding: 10px 20px; + border-bottom: 2px solid; + } + + .collapse-title > i { + color: inherit; + font-size: 24px; + } </style> <body> <a-layout id="app" v-cloak> @@ -35,8 +63,14 @@ <a-button type="primary" :disabled="saveBtnDisable" @click="updateAllSetting">{{ i18n "pages.settings.save" }}</a-button> <a-button type="danger" :disabled="!saveBtnDisable" @click="restartPanel">{{ i18n "pages.settings.restartPanel" }}</a-button> </a-space> - <a-tabs style="margin:1rem 0.5rem;" default-active-key="1" :class="themeSwitcher.darkCardClass" > + <a-tabs style="margin:1rem 0.5rem;" default-active-key="1" :class="themeSwitcher.darkCardClass"> <a-tab-pane key="1" tab='{{ i18n "pages.settings.panelSettings"}}'> + <a-row :xs="24" :sm="24" :lg="12"> + <h2 class="alert-msg"> + <a-icon type="warning"></a-icon> + {{ i18n "pages.settings.infoDesc" }} + </h2> + </a-row> <a-list item-layout="horizontal" :style="themeSwitcher.textStyle"> <setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningIP"}}' desc='{{ i18n "pages.settings.panelListeningIPDesc"}}' v-model="allSetting.webListen"></setting-list-item> <setting-list-item type="number" title='{{ i18n "pages.settings.panelPort"}}' desc='{{ i18n "pages.settings.panelPortDesc"}}' v-model="allSetting.webPort" :min="0"></setting-list-item> @@ -72,12 +106,6 @@ </a-row> </a-list-item> </a-list> - <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 16px; padding: 5px 5px; text-align: center;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> - {{ i18n "pages.settings.infoDesc" }} - </h2> - </a-row> </a-tab-pane> <a-tab-pane key="2" tab='{{ i18n "pages.settings.securitySettings"}}' style="padding: 20px;"> <a-tabs class="ant-card-dark-securitybox-nohover" default-active-key="sec-1" :class="themeSwitcher.darkCardClass"> @@ -144,8 +172,8 @@ </a-space> <a-divider style="padding: 20px;">{{ i18n "pages.settings.templates.title"}} </a-divider> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 16px; padding: 5px 5px; text-align: center;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="alert-msg"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.infoDesc" }} </h2> </a-row> @@ -154,8 +182,8 @@ <a-collapse> <a-collapse-panel header='{{ i18n "pages.settings.templates.generalConfigs"}}'> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 18px; padding: 10px 20px; border-bottom: 2px solid;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="collapse-title"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.templates.generalConfigsDesc" }} </h2> </a-row> @@ -199,8 +227,8 @@ </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.templates.blockConfigs"}}'> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 18px; padding: 10px 20px; border-bottom: 2px solid;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="collapse-title"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.templates.blockConfigsDesc" }} </h2> </a-row> @@ -212,8 +240,8 @@ </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.templates.blockCountryConfigs"}}'> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 18px; padding: 10px 20px; border-bottom: 2px solid;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="collapse-title"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.templates.blockCountryConfigsDesc" }} </h2> </a-row> @@ -226,8 +254,8 @@ </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.templates.directCountryConfigs"}}'> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 18px; padding: 10px 20px; border-bottom: 2px solid;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="collapse-title"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.templates.directCountryConfigsDesc" }} </h2> </a-row> @@ -240,8 +268,8 @@ </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.templates.ipv4Configs"}}'> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 18px; padding: 10px 20px; border-bottom: 2px solid;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="collapse-title"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.templates.ipv4ConfigsDesc" }} </h2> </a-row> @@ -250,8 +278,8 @@ </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.templates.warpConfigs"}}'> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 18px; padding: 10px 20px; border-bottom: 2px solid;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="collapse-title"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.templates.warpConfigsDesc" }} </h2> </a-row> @@ -262,8 +290,8 @@ </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.templates.manualLists"}}'> <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 18px; padding: 10px 20px; border-bottom: 2px solid;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> + <h2 class="collapse-title"> + <a-icon type="warning"></a-icon> {{ i18n "pages.settings.templates.manualListsDesc" }} </h2> </a-row> @@ -271,6 +299,8 @@ <setting-list-item type="textarea" title='{{ i18n "pages.settings.templates.manualBlockedDomains"}}' v-model="manualBlockedDomains"></setting-list-item> <setting-list-item type="textarea" title='{{ i18n "pages.settings.templates.manualDirectIPs"}}' v-model="manualDirectIPs"></setting-list-item> <setting-list-item type="textarea" title='{{ i18n "pages.settings.templates.manualDirectDomains"}}' v-model="manualDirectDomains"></setting-list-item> + <setting-list-item type="textarea" title='{{ i18n "pages.settings.templates.manualIPv4Domains"}}' v-model="manualIPv4Domains"></setting-list-item> + <setting-list-item type="textarea" title='{{ i18n "pages.settings.templates.manualWARPDomains"}}' v-model="manualWARPDomains"></setting-list-item> </a-collapse-panel> </a-collapse> </a-tab-pane> @@ -295,6 +325,12 @@ </a-tab-pane> <a-tab-pane key="4" tab='{{ i18n "pages.settings.TGBotSettings"}}'> + <a-row :xs="24" :sm="24" :lg="12"> + <h2 class="alert-msg"> + <a-icon type="warning"></a-icon> + {{ i18n "pages.settings.infoDesc" }} + </h2> + </a-row> <a-list item-layout="horizontal" :style="themeSwitcher.textStyle"> <setting-list-item type="switch" title='{{ i18n "pages.settings.telegramBotEnable" }}' desc='{{ i18n "pages.settings.telegramBotEnableDesc" }}' v-model="allSetting.tgBotEnable"></setting-list-item> <setting-list-item type="text" title='{{ i18n "pages.settings.telegramToken"}}' desc='{{ i18n "pages.settings.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item> @@ -302,13 +338,30 @@ <setting-list-item type="text" title='{{ i18n "pages.settings.telegramNotifyTime"}}' desc='{{ i18n "pages.settings.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item> <setting-list-item type="switch" title='{{ i18n "pages.settings.tgNotifyBackup" }}' desc='{{ i18n "pages.settings.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item> <setting-list-item type="number" title='{{ i18n "pages.settings.tgNotifyCpu" }}' desc='{{ i18n "pages.settings.tgNotifyCpuDesc" }}' v-model="allSetting.tgCpu" :min="0" :max="100"></setting-list-item> + <a-list-item> + <a-row style="padding: 20px"> + <a-col :lg="24" :xl="12"> + <a-list-item-meta title="Telegram Bot Language" /> + </a-col> + + <a-col :lg="24" :xl="12"> + <template> + <a-select + ref="selectBotLang" + v-model="allSetting.tgLang" + :dropdown-class-name="themeSwitcher.darkCardClass" + style="width: 100%" + > + <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs"> + <span role="img" aria-label="l.name" v-text="l.icon"></span> + <span v-text="l.name"></span> + </a-select-option> + </a-select> + </template> + </a-col> + </a-row> + </a-list-item> </a-list> - <a-row :xs="24" :sm="24" :lg="12"> - <h2 style="color: inherit; font-weight: bold; font-size: 16px; padding: 5px 5px; text-align: center;"> - <a-icon type="warning" style="color: inherit; font-size: 24px;"></a-icon> - {{ i18n "pages.settings.infoDesc" }} - </h2> - </a-row> </a-tab-pane> </a-tabs> </a-space> @@ -452,7 +505,12 @@ if (msg.success) { this.loading(true); await PromiseUtil.sleep(5000); - window.location.replace(this.allSetting.webBasePath + "panel/settings"); + let protocol = "http://"; + if (this.allSetting.webCertFile !== "") { + protocol = "https://"; + } + const { host, pathname } = window.location; + window.location.replace(protocol + host + this.allSetting.webBasePath + pathname.slice(1)); } }, async fetchUserSecret() { @@ -584,30 +642,30 @@ 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) }, + 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 + 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 + 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 + newTemplateSettings.routing.rules = JSON.parse(newValue); + this.templateSettings = newTemplateSettings; }, }, freedomStrategy: { @@ -682,6 +740,24 @@ this.syncRulesWithOutbound("direct", this.directSettings); } }, + ipv4Domains: { + get: function () { + return this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" }); + }, + set: function (newValue) { + this.templateRuleSetter({ outboundTag: "IPv4", property: "domain", data: newValue }); + this.syncRulesWithOutbound("IPv4", this.ipv4Settings); + } + }, + warpDomains: { + get: function () { + return this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); + }, + set: function (newValue) { + this.templateRuleSetter({ outboundTag: "WARP", property: "domain", data: newValue }); + this.syncRulesWithOutbound("WARP", this.warpSettings); + } + }, manualBlockedIPs: { get: function () { return JSON.stringify(this.blockedIPs, null, 2); }, set: debounce(function (value) { this.blockedIPs = JSON.parse(value); }, 1000) @@ -698,6 +774,14 @@ get: function () { return JSON.stringify(this.directDomains, null, 2); }, set: debounce(function (value) { this.directDomains = JSON.parse(value); }, 1000) }, + manualIPv4Domains: { + get: function () { return JSON.stringify(this.ipv4Domains, null, 2); }, + set: debounce(function (value) { this.ipv4Domains = JSON.parse(value); }, 1000) + }, + manualWARPDomains: { + get: function () { return JSON.stringify(this.warpDomains, null, 2); }, + set: debounce(function (value) { this.warpDomains = JSON.parse(value); }, 1000) + }, torrentSettings: { get: function () { return doAllItemsExist(this.settingsData.protocols.bittorrent, this.blockedProtocols); @@ -763,40 +847,26 @@ }, GoogleIPv4Settings: { get: function () { - return doAllItemsExist(this.settingsData.domains.google, this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.google, this.ipv4Domains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.google]; + this.ipv4Domains = [...this.ipv4Domains, ...this.settingsData.domains.google]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.google.includes(data)) + this.ipv4Domains = this.ipv4Domains.filter(data => !this.settingsData.domains.google.includes(data)); } - this.templateRuleSetter({ - outboundTag: "IPv4", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("IPv4", this.ipv4Settings); }, }, NetflixIPv4Settings: { get: function () { - return doAllItemsExist(this.settingsData.domains.netflix, this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.netflix, this.ipv4Domains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.netflix]; + this.ipv4Domains = [...this.ipv4Domains, ...this.settingsData.domains.netflix]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.netflix.includes(data)) + this.ipv4Domains = this.ipv4Domains.filter(data => !this.settingsData.domains.netflix.includes(data)); } - this.templateRuleSetter({ - outboundTag: "IPv4", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("IPv4", this.ipv4Settings); }, }, IRIpSettings: { @@ -945,78 +1015,50 @@ }, GoogleWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.google, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.google, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.google]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.google]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.google.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.google.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, OpenAIWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.openai, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.openai, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.openai]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.openai]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.openai.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.openai.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, NetflixWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.netflix, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.netflix, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.netflix]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.netflix]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.netflix.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.netflix.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, SpotifyWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.spotify, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.spotify, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.spotify]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.spotify]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.spotify.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.spotify.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, }, |
