From 9fba92d879767394535f70ba83f0a58d6b063a7d Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 26 Jan 2024 22:07:15 +0330 Subject: v2.1.2 revert #1650 #1661 #1664 #1670 made panel full of bug --- web/html/common/qrcode_modal.html | 17 ++--- web/html/xui/client_modal.html | 154 ++++---------------------------------- web/html/xui/form/client.html | 16 +--- web/html/xui/inbound_modal.html | 4 - web/html/xui/inbounds.html | 82 ++++---------------- 5 files changed, 38 insertions(+), 235 deletions(-) (limited to 'web/html') diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 31b3450c..3c4fd929 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -11,12 +11,10 @@ Subscription
- {{ i18n "pages.inbounds.client" }} - @@ -377,7 +373,7 @@

[[ clientEmail ]]

[[ clientCount[dbInbound.id].online.length ]] - + @@ -744,9 +740,6 @@ case "delDepletedClients": this.delDepletedClients(-1) break; - case "addGroupClient": - this.openGroupAddClient() - break; } }, clickAction(action, dbInbound) { @@ -890,20 +883,6 @@ await this.submit(`/panel/inbound/update/${dbInbound.id}`, data, inModal); }, - openGroupAddClient() { - clientModal.show({ - title: '{{ i18n "pages.client.groupAdd"}}', - okText: '{{ i18n "pages.client.submitAdd"}}', - dbInbounds: this.dbInbounds, - confirm: async (clients, dbInboundIds) => { - clientModal.loading(); - await this.addGroupClient(clients, dbInboundIds); - clientModal.close(); - await this.showQrcode(dbInboundIds[0],clients[0], true) - }, - isEdit: false - }); - }, openAddClient(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); clientModal.show({ @@ -914,7 +893,6 @@ clientModal.loading(); await this.addClient(clients, dbInboundId); clientModal.close(); - await this.showQrcode(dbInboundId,clients) }, isEdit: false }); @@ -939,7 +917,6 @@ clientModal.show({ title: '{{ i18n "pages.client.edit"}}', okText: '{{ i18n "pages.client.submitEdit"}}', - dbInbounds: this.dbInbounds, dbInbound: dbInbound, index: index, confirm: async (client, dbInboundId, clientId) => { @@ -963,41 +940,14 @@ id: dbInboundId, settings: '{"clients": [' + clients.toString() + ']}', }; - - await this.submit(`/panel/inbound/addClient`, data) - }, - - async addGroupClient(clients, dbInboundIds) { - const data = [] - dbInboundIds.forEach((dbInboundId, index) => { - data.push({ - id: dbInboundId, - settings: '{"clients": [' + clients[index].toString() + ']}', - }) - }) - - await this.submit(`/panel/inbound/addGroupClient`, data, true) + await this.submit(`/panel/inbound/addClient`, data); }, async updateClient(client, dbInboundId, clientId) { - if (Array.isArray(client) && Array.isArray(dbInboundId) && Array.isArray(clientId)){ - const data = [] - client.forEach((client, index) => { - data.push({ - clientId: clientId[index], - inbound: { - id: dbInboundId[index], - settings: '{"clients": [' + client.toString() + ']}', - } - }) - }) - await this.submit(`/panel/inbound/updateClients`, data, true); - }else{ - const data = { - id: dbInboundId, - settings: '{"clients": [' + client.toString() + ']}', - }; - await this.submit(`/panel/inbound/updateClient/${clientId}`, data); - } + const data = { + id: dbInboundId, + settings: '{"clients": [' + client.toString() + ']}', + }; + await this.submit(`/panel/inbound/updateClient/${clientId}`, data); }, resetTraffic(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); @@ -1051,8 +1001,8 @@ checkFallback(dbInbound) { newDbInbound = new DBInbound(dbInbound); if (dbInbound.listen.startsWith("@")){ - rootInbound = this.inbounds.find((i) => - i.isTcp && + rootInbound = this.inbounds.find((i) => + i.isTcp && ['trojan','vless'].includes(i.protocol) && i.settings.fallbacks.find(f => f.dest === dbInbound.listen) ); @@ -1068,10 +1018,10 @@ } return newDbInbound; }, - showQrcode(dbInboundId, client, isJustSub = false) { + showQrcode(dbInboundId, client) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); newDbInbound = this.checkFallback(dbInbound); - qrModal.show('{{ i18n "qrCode"}}', newDbInbound, client, isJustSub); + qrModal.show('{{ i18n "qrCode"}}', newDbInbound, client); }, showInfo(dbInboundId, client) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); @@ -1100,8 +1050,8 @@ await this.updateClient(clients[index], dbInboundId, clientId); this.loading(false); }, - async submit(url, data, isJson = false) { - const msg = isJson ? await HttpUtil.postWithModalJson(url, data) : await HttpUtil.postWithModal(url, data); + async submit(url, data) { + const msg = await HttpUtil.postWithModal(url, data); if (msg.success) { await this.getDBInbounds(); } @@ -1243,7 +1193,7 @@ value: '', okText: '{{ i18n "pages.inbounds.import" }}', confirm: async (dbInboundText) => { - await this.submit('/panel/inbound/import', {data: dbInboundText}); + await this.submit('/panel/inbound/import', {data: dbInboundText}, promptModal); promptModal.close(); }, }); -- cgit v1.2.3