diff options
| author | Ho3ein <ho3ein.sanaei@gmail.com> | 2023-05-13 12:48:36 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-13 12:48:36 +0300 |
| commit | 5468069befd602a7ae51deb5b76150ee16d426d6 (patch) | |
| tree | a41b4492b37e52e033b2f4e027da05ce8893ae50 /web/html/xui | |
| parent | 3bec9ee2737d0a8c49f4d705f1d8c8925bb8a2a8 (diff) | |
| parent | 0cce35784eb2ab8ce42e88bdf63e0284254d2e14 (diff) | |
Merge pull request #420 from hamid-gh98/main
[fix] russia domains in settings and More....
Diffstat (limited to 'web/html/xui')
| -rw-r--r-- | web/html/xui/client_modal.html | 6 | ||||
| -rw-r--r-- | web/html/xui/common_sider.html | 8 | ||||
| -rw-r--r-- | web/html/xui/component/themeSwitch.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/client.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/shadowsocks.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/trojan.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/vless.html | 4 | ||||
| -rw-r--r-- | web/html/xui/form/protocol/vmess.html | 4 | ||||
| -rw-r--r-- | web/html/xui/inbound_info_modal.html | 13 | ||||
| -rw-r--r-- | web/html/xui/inbounds.html | 31 | ||||
| -rw-r--r-- | web/html/xui/index.html | 2 | ||||
| -rw-r--r-- | web/html/xui/settings.html | 57 |
12 files changed, 89 insertions, 52 deletions
diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index 89175f31..f7faf888 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -135,7 +135,7 @@ client.email = string; }, async getDBClientIps(email, event) { - const msg = await HttpUtil.post('/xui/inbound/clientIps/' + email); + const msg = await HttpUtil.post('/panel/inbound/clientIps/' + email); if (!msg.success) { return; } @@ -149,7 +149,7 @@ } }, async clearDBClientIps(email) { - const msg = await HttpUtil.post('/xui/inbound/clearClientIps/' + email); + const msg = await HttpUtil.post('/panel/inbound/clearClientIps/' + email); if (!msg.success) { return; } @@ -164,7 +164,7 @@ cancelText: '{{ i18n "cancel"}}', onOk: async () => { iconElement.disabled = true; - const msg = await HttpUtil.postWithModal('/xui/inbound/' + dbInboundId + '/resetClientTraffic/' + email); + const msg = await HttpUtil.postWithModal('/panel/inbound/' + dbInboundId + '/resetClientTraffic/' + email); if (msg.success) { this.clientModal.clientStats.up = 0; this.clientModal.clientStats.down = 0; diff --git a/web/html/xui/common_sider.html b/web/html/xui/common_sider.html index 94a2e4a3..58072f82 100644 --- a/web/html/xui/common_sider.html +++ b/web/html/xui/common_sider.html @@ -1,17 +1,17 @@ {{define "menuItems"}} -<a-menu-item key="{{ .base_path }}xui/"> +<a-menu-item key="{{ .base_path }}panel/"> <a-icon type="dashboard"></a-icon> <span>{{ i18n "menu.dashboard"}}</span> </a-menu-item> -<a-menu-item key="{{ .base_path }}xui/inbounds"> +<a-menu-item key="{{ .base_path }}panel/inbounds"> <a-icon type="user"></a-icon> <span>{{ i18n "menu.inbounds"}}</span> </a-menu-item> -<a-menu-item key="{{ .base_path }}xui/settings"> +<a-menu-item key="{{ .base_path }}panel/settings"> <a-icon type="setting"></a-icon> <span>{{ i18n "menu.settings"}}</span> </a-menu-item> -<!--<a-menu-item key="{{ .base_path }}xui/clients">--> +<!--<a-menu-item key="{{ .base_path }}panel/clients">--> <!-- <a-icon type="laptop"></a-icon>--> <!-- <span>Client</span>--> <!--</a-menu-item>--> diff --git a/web/html/xui/component/themeSwitch.html b/web/html/xui/component/themeSwitch.html index 35013a9e..7cbedecf 100644 --- a/web/html/xui/component/themeSwitch.html +++ b/web/html/xui/component/themeSwitch.html @@ -28,7 +28,7 @@ isDarkTheme, bgStyle: `background: ${colors[theme].bg};`, textStyle: `color: ${colors[theme].text};`, - darkClass: isDarkTheme ? 'ant-card-dark' : '', + darkClass: isDarkTheme ? 'ant-dark' : '', darkCardClass: isDarkTheme ? 'ant-card-dark' : '', darkDrawerClass: isDarkTheme ? 'ant-drawer-dark' : '', get currentTheme() { @@ -40,7 +40,7 @@ localStorage.setItem('dark-mode', this.isDarkTheme); this.bgStyle = `background: ${colors[this.theme].bg};`; this.textStyle = `color: ${colors[this.theme].text};`; - this.darkClass = this.isDarkTheme ? 'ant-card-dark' : ''; + this.darkClass = this.isDarkTheme ? 'ant-dark' : ''; this.darkCardClass = this.isDarkTheme ? 'ant-card-dark' : ''; this.darkDrawerClass = this.isDarkTheme ? 'ant-drawer-dark' : ''; }, diff --git a/web/html/xui/form/client.html b/web/html/xui/form/client.html index c8ab09cf..1aaf9073 100644 --- a/web/html/xui/form/client.html +++ b/web/html/xui/form/client.html @@ -11,10 +11,10 @@ <br> <a-form-item> <span slot="label"> - <span>{{ i18n "pages.inbounds.Email" }}</span> + <span>{{ i18n "pages.inbounds.email" }}</span> <a-tooltip> <template slot="title"> - <span>{{ i18n "pages.inbounds.EmailDesc" }}</span> + <span>{{ i18n "pages.inbounds.emailDesc" }}</span> </template> <a-icon type="sync" @click="getNewEmail(client)"></a-icon> </a-tooltip> diff --git a/web/html/xui/form/protocol/shadowsocks.html b/web/html/xui/form/protocol/shadowsocks.html index f37c1a90..b59b4722 100644 --- a/web/html/xui/form/protocol/shadowsocks.html +++ b/web/html/xui/form/protocol/shadowsocks.html @@ -4,10 +4,10 @@ <a-collapse-panel header='{{ i18n "pages.inbounds.client" }}'> <a-form-item> <span slot="label"> - <span>{{ i18n "pages.inbounds.Email" }}</span> + <span>{{ i18n "pages.inbounds.email" }}</span> <a-tooltip> <template slot="title"> - <span>{{ i18n "pages.inbounds.EmailDesc" }}</span> + <span>{{ i18n "pages.inbounds.emailDesc" }}</span> </template> <a-icon @click="getNewEmail(client)" type="sync"></a-icon> </a-tooltip> diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index 4a2518a7..2b6a2a3b 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -4,10 +4,10 @@ <a-collapse-panel header='{{ i18n "pages.inbounds.client" }}'> <a-form-item> <span slot="label"> - <span>{{ i18n "pages.inbounds.Email" }}</span> + <span>{{ i18n "pages.inbounds.email" }}</span> <a-tooltip> <template slot="title"> - <span>{{ i18n "pages.inbounds.EmailDesc" }}</span> + <span>{{ i18n "pages.inbounds.emailDesc" }}</span> </template> <a-icon type="sync" @click="getNewEmail(client)"></a-icon> </a-tooltip> diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html index 12b15711..b253a4a3 100644 --- a/web/html/xui/form/protocol/vless.html +++ b/web/html/xui/form/protocol/vless.html @@ -4,10 +4,10 @@ <a-collapse-panel header='{{ i18n "pages.inbounds.client" }}'> <a-form-item> <span slot="label"> - <span>{{ i18n "pages.inbounds.Email" }}</span> + <span>{{ i18n "pages.inbounds.email" }}</span> <a-tooltip> <template slot="title"> - <span>{{ i18n "pages.inbounds.EmailDesc" }}</span> + <span>{{ i18n "pages.inbounds.emailDesc" }}</span> </template> <a-icon type="sync" @click="getNewEmail(client)"></a-icon> </a-tooltip> diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html index 2b02bd14..f703210b 100644 --- a/web/html/xui/form/protocol/vmess.html +++ b/web/html/xui/form/protocol/vmess.html @@ -4,10 +4,10 @@ <a-collapse-panel header='{{ i18n "pages.inbounds.client" }}'> <a-form-item> <span slot="label"> - <span>{{ i18n "pages.inbounds.Email" }}</span> + <span>{{ i18n "pages.inbounds.email" }}</span> <a-tooltip> <template slot="title"> - <span>{{ i18n "pages.inbounds.EmailDesc" }}</span> + <span>{{ i18n "pages.inbounds.emailDesc" }}</span> </template> <a-icon type="sync" @click="getNewEmail(client)"></a-icon> </a-tooltip> diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index cfaddf3b..d9d0637c 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -114,6 +114,7 @@ <tr v-if="infoModal.clientSettings.subId"> <td>Subscription link</td> <td><a :href="[[ subBase + infoModal.clientSettings.subId ]]" target="_blank">[[ subBase + infoModal.clientSettings.subId ]]</a></td> + <td><a-icon id="copy-sub-link" type="snippets" @click="copyToClipboard('copy-sub-link', subBase + infoModal.clientSettings.subId)"></a-icon></td> </tr> <tr v-if="infoModal.clientSettings.tgId"> <td>Telegram ID</td> @@ -190,7 +191,7 @@ <div v-if="dbInbound.hasLink()"> <a-divider>URL</a-divider> <p>[[ infoModal.link ]]</p> - <button class="ant-btn ant-btn-primary" id="copy-url-link"><a-icon type="snippets"></a-icon>{{ i18n "copy" }}</button> + <button class="ant-btn ant-btn-primary" id="copy-url-link" @click="copyToClipboard('copy-url-link', infoModal.link)"><a-icon type="snippets"></a-icon>{{ i18n "copy" }}</button> </div> </a-modal> <script> @@ -218,14 +219,6 @@ this.isExpired = this.inbound.isExpiry(index); this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : []; this.visible = true; - infoModalApp.$nextTick(() => { - if (this.clipboard === null) { - this.clipboard = new ClipboardJS('#copy-url-link', { - text: () => this.link, - }); - this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}')); - } - }); }, close() { infoModal.visible = false; @@ -263,7 +256,7 @@ }, }, methods: { - copyTextToClipboard(elmentId, content) { + copyToClipboard(elmentId, content) { this.infoModal.clipboard = new ClipboardJS('#' + elmentId, { text: () => content, }); diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 080a08cc..a80fe79a 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -338,7 +338,7 @@ }, async getDBInbounds() { this.refreshing = true; - const msg = await HttpUtil.post('/xui/inbound/list'); + const msg = await HttpUtil.post('/panel/inbound/list'); if (!msg.success) { return; } @@ -346,7 +346,7 @@ this.refreshing = false; }, async getDefaultSettings() { - const msg = await HttpUtil.post('/xui/setting/defaultSettings'); + const msg = await HttpUtil.post('/panel/setting/defaultSettings'); if (!msg.success) { return; } @@ -509,7 +509,7 @@ streamSettings: baseInbound.stream.toString(), sniffing: baseInbound.canSniffing() ? baseInbound.sniffing.toString() : '{}', }; - await this.submit('/xui/inbound/add', data, inModal); + await this.submit('/panel/inbound/add', data, inModal); }, openAddInbound() { inModal.show({ @@ -558,7 +558,7 @@ if (inbound.canEnableStream()) data.streamSettings = inbound.stream.toString(); if (inbound.canSniffing()) data.sniffing = inbound.sniffing.toString(); - await this.submit('/xui/inbound/add', data, inModal); + await this.submit('/panel/inbound/add', data, inModal); }, async updateInbound(inbound, dbInbound) { const data = { @@ -577,7 +577,7 @@ if (inbound.canEnableStream()) data.streamSettings = inbound.stream.toString(); if (inbound.canSniffing()) data.sniffing = inbound.sniffing.toString(); - await this.submit(`/xui/inbound/update/${dbInbound.id}`, data, inModal); + await this.submit(`/panel/inbound/update/${dbInbound.id}`, data, inModal); }, openAddClient(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); @@ -632,14 +632,14 @@ id: dbInboundId, settings: '{"clients": [' + clients.toString() + ']}', }; - await this.submit(`/xui/inbound/addClient`, data); + await this.submit(`/panel/inbound/addClient`, data); }, async updateClient(client, dbInboundId, clientId) { const data = { id: dbInboundId, settings: '{"clients": [' + client.toString() + ']}', }; - await this.submit(`/xui/inbound/updateClient/${clientId}`, data); + await this.submit(`/panel/inbound/updateClient/${clientId}`, data); }, resetTraffic(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); @@ -664,7 +664,7 @@ class: themeSwitcher.darkCardClass, okText: '{{ i18n "delete"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/xui/inbound/del/' + dbInboundId), + onOk: () => this.submit('/panel/inbound/del/' + dbInboundId), }); }, delClient(dbInboundId, client) { @@ -676,7 +676,7 @@ class: themeSwitcher.darkCardClass, okText: '{{ i18n "delete"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit(`/xui/inbound/${dbInboundId}/delClient/${clientId}`), + onOk: () => this.submit(`/panel/inbound/${dbInboundId}/delClient/${clientId}`), }); }, getClients(protocol, clientSettings) { @@ -696,15 +696,16 @@ } }, showQrcode(dbInbound, clientIndex) { + const clientName = JSON.parse(dbInbound.settings).clients[clientIndex].email; const link = dbInbound.genLink(clientIndex); - qrModal.show('{{ i18n "qrCode"}}', link, dbInbound); + qrModal.show('{{ i18n "qrCode"}}', link, dbInbound, '', clientName); }, showInfo(dbInbound, index) { infoModal.show(dbInbound, index); }, switchEnable(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); - this.submit(`/xui/inbound/update/${dbInboundId}`, dbInbound); + this.submit(`/panel/inbound/update/${dbInboundId}`, dbInbound); }, async switchEnableClient(dbInboundId, client) { this.loading() @@ -741,7 +742,7 @@ class: themeSwitcher.darkCardClass, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/xui/inbound/' + dbInboundId + '/resetClientTraffic/' + client.email), + onOk: () => this.submit('/panel/inbound/' + dbInboundId + '/resetClientTraffic/' + client.email), }) }, resetAllTraffic() { @@ -751,7 +752,7 @@ class: themeSwitcher.darkCardClass, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/xui/inbound/resetAllTraffics'), + onOk: () => this.submit('/panel/inbound/resetAllTraffics'), }); }, resetAllClientTraffics(dbInboundId) { @@ -761,7 +762,7 @@ class: themeSwitcher.darkCardClass, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/xui/inbound/resetAllClientTraffics/' + dbInboundId), + onOk: () => this.submit('/panel/inbound/resetAllClientTraffics/' + dbInboundId), }) }, delDepletedClients(dbInboundId) { @@ -771,7 +772,7 @@ class: themeSwitcher.darkCardClass, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/xui/inbound/delDepletedClients/' + dbInboundId), + onOk: () => this.submit('/panel/inbound/delDepletedClients/' + dbInboundId), }) }, isExpiry(dbInbound, index) { diff --git a/web/html/xui/index.html b/web/html/xui/index.html index 73936b29..fa7d576e 100644 --- a/web/html/xui/index.html +++ b/web/html/xui/index.html @@ -500,7 +500,7 @@ return; } this.loading(true); - const restartMsg = await HttpUtil.post("/xui/setting/restartPanel"); + const restartMsg = await HttpUtil.post("/panel/setting/restartPanel"); this.loading(false); if (restartMsg.success) { this.loading(true); diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index d50822c2..9dec0e0c 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -153,6 +153,7 @@ <setting-list-item type="switch" title='{{ i18n "pages.settings.templates.xrayConfigPrivateIp"}}' desc='{{ i18n "pages.settings.templates.xrayConfigPrivateIpDesc"}}' v-model="privateIpSettings"></setting-list-item> <setting-list-item type="switch" title='{{ i18n "pages.settings.templates.xrayConfigAds"}}' desc='{{ i18n "pages.settings.templates.xrayConfigAdsDesc"}}' v-model="AdsSettings"></setting-list-item> <setting-list-item type="switch" title='{{ i18n "pages.settings.templates.xrayConfigPorn"}}' desc='{{ i18n "pages.settings.templates.xrayConfigPornDesc"}}' v-model="PornSettings"></setting-list-item> + <setting-list-item type="switch" title='{{ i18n "pages.settings.templates.xrayConfigSpeedtest"}}' desc='{{ i18n "pages.settings.templates.xrayConfigSpeedtestDesc"}}' v-model="SpeedTestSettings"></setting-list-item> </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.templates.countryConfigs"}}'> <a-row :xs="24" :sm="24" :lg="12"> @@ -285,6 +286,7 @@ "geosite:spotify-ads" ], porn: ["geosite:category-porn"], + speedtest: ["geosite:speedtest"], openai: ["geosite:openai"], google: ["geosite:google"], spotify: ["geosite:spotify"], @@ -307,13 +309,16 @@ }, } }, + created() { + this.checkForGeosites(); + }, methods: { loading(spinning = true, obj) { if (obj == null) this.spinning = spinning; }, async getAllSetting() { this.loading(true); - const msg = await HttpUtil.post("/xui/setting/all"); + const msg = await HttpUtil.post("/panel/setting/all"); this.loading(false); if (msg.success) { this.oldAllSetting = new AllSetting(msg.obj); @@ -324,7 +329,7 @@ }, async updateAllSetting() { this.loading(true); - const msg = await HttpUtil.post("/xui/setting/update", this.allSetting); + const msg = await HttpUtil.post("/panel/setting/update", this.allSetting); this.loading(false); if (msg.success) { await this.getAllSetting(); @@ -332,7 +337,7 @@ }, async updateUser() { this.loading(true); - const msg = await HttpUtil.post("/xui/setting/updateUser", this.user); + const msg = await HttpUtil.post("/panel/setting/updateUser", this.user); this.loading(false); if (msg.success) { this.user = {}; @@ -350,7 +355,7 @@ }); }); this.loading(true); - const msg = await HttpUtil.post("/xui/setting/restartPanel"); + const msg = await HttpUtil.post("/panel/setting/restartPanel"); this.loading(false); if (msg.success) { this.loading(true); @@ -359,7 +364,7 @@ } }, async getUserSecret() { - const user_msg = await HttpUtil.post("/xui/setting/getUserSecret", this.user); + const user_msg = await HttpUtil.post("/panel/setting/getUserSecret", this.user); if (user_msg.success) { this.user = user_msg.obj; } @@ -367,7 +372,7 @@ }, async updateSecret() { this.loading(true); - const msg = await HttpUtil.post("/xui/setting/updateUserSecret", this.user); + const msg = await HttpUtil.post("/panel/setting/updateUserSecret", this.user); if (msg.success) { this.user = msg.obj; window.location.replace(basePath + "logout") @@ -394,13 +399,34 @@ }, async resetXrayConfigToDefault() { this.loading(true); - const msg = await HttpUtil.get("/xui/setting/getDefaultJsonConfig"); + const msg = await HttpUtil.get("/panel/setting/getDefaultJsonConfig"); this.loading(false); if (msg.success) { this.templateSettings = JSON.parse(JSON.stringify(msg.obj, null, 2)); this.saveBtnDisable = true; } }, + checkForGeosites() { + const domainsToCheck = [ + { + query: "category-ru-gov", + key: "this.settingsData.domains.ru", + data: [ + "geosite:category-ru-gov", + "regexp:.*\\.ru$" + ] + }, + ]; + this.loading(true); + domainsToCheck.forEach(async (dd) => { + const msg = await HttpUtil.get(`/panel/setting/searchDatafiles?query=${dd.query}`); + if (msg.success && msg.obj) { + [dd.key] = dd.data; + console.log([dd.key]) + } + }) + this.loading(false); + }, checkRequiredOutbounds() { const newTemplateSettings = this.templateSettings; const haveIPv4Outbounds = newTemplateSettings.outbounds.some((o) => o?.tag === "IPv4"); @@ -573,6 +599,23 @@ }); }, }, + SpeedTestSettings: { + get: function () { + return this.templateRuleGetter({ + outboundTag: "blocked", + property: "domain", + data: this.settingsData.domains.speedtest + }); + }, + set: function (newValue) { + this.templateRuleSetter({ + newValue, + outboundTag: "blocked", + property: "domain", + data: this.settingsData.domains.speedtest + }); + }, + }, GoogleIPv4Settings: { get: function () { return this.templateRuleGetter({ |
