diff options
| author | Ali Rahimi <alirahimi818@gmail.com> | 2024-01-22 14:36:01 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2024-01-22 14:38:36 +0300 |
| commit | b172d450e3a9dba8a56b2f6cd9e059559d232033 (patch) | |
| tree | f4a84c9a37b771eb16799d294ffafd41ef13b8b0 /web/html/xui/inbounds.html | |
| parent | 5c695ca6520c9cd9c44b18119a862f8f480969af (diff) | |
Group editing feature of users with the same subscription (#1661)
Diffstat (limited to 'web/html/xui/inbounds.html')
| -rw-r--r-- | web/html/xui/inbounds.html | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 53693ab3..e5d4b821 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -894,7 +894,7 @@ clientModal.show({ title: '{{ i18n "pages.client.groupAdd"}}', okText: '{{ i18n "pages.client.submitAdd"}}', - dbInbound: this.dbInbounds, + dbInbounds: this.dbInbounds, confirm: async (clients, dbInboundIds) => { clientModal.loading(); await this.addGroupClient(clients, dbInboundIds); @@ -939,6 +939,7 @@ clientModal.show({ title: '{{ i18n "pages.client.edit"}}', okText: '{{ i18n "pages.client.submitEdit"}}', + dbInbounds: this.dbInbounds, dbInbound: dbInbound, index: index, confirm: async (client, dbInboundId, clientId) => { @@ -958,10 +959,10 @@ } }, async addClient(clients, dbInboundId) { - const data = [{ + const data = { id: dbInboundId, settings: '{"clients": [' + clients.toString() + ']}', - }]; + }; await this.submit(`/panel/inbound/addClient`, data, true) }, @@ -975,14 +976,28 @@ }) }) - await this.submit(`/panel/inbound/addClient`, data, true) + await this.submit(`/panel/inbound/addGroupClient`, data, true) }, async updateClient(client, dbInboundId, clientId) { - const data = { - id: dbInboundId, - settings: '{"clients": [' + client.toString() + ']}', - }; - await this.submit(`/panel/inbound/updateClient/${clientId}`, data); + 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); + } }, resetTraffic(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); |
