mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-13 21:43:03 +00:00
Revert "fix getSubGroupClients for enable/disable and edit clients."
This commit is contained in:
parent
773ca0c239
commit
e2f2353da9
1 changed files with 30 additions and 0 deletions
|
@ -1108,6 +1108,36 @@
|
||||||
this.submit(`/panel/inbound/${dbInboundId}/delClient/${clientId}`);
|
this.submit(`/panel/inbound/${dbInboundId}/delClient/${clientId}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getSubGroupClients(dbInbounds, currentClient) {
|
||||||
|
const response = {
|
||||||
|
inbounds: [],
|
||||||
|
clients: [],
|
||||||
|
editIds: []
|
||||||
|
}
|
||||||
|
if (dbInbounds && dbInbounds.length > 0 && currentClient) {
|
||||||
|
dbInbounds.forEach((dbInboundItem) => {
|
||||||
|
const dbInbound = new DBInbound(dbInboundItem);
|
||||||
|
if (dbInbound) {
|
||||||
|
const inbound = dbInbound.toInbound();
|
||||||
|
if (inbound) {
|
||||||
|
const clients = inbound.clients;
|
||||||
|
if (clients.length > 0) {
|
||||||
|
clients.forEach((client) => {
|
||||||
|
if (client['subId'] === currentClient['subId']) {
|
||||||
|
client['inboundId'] = dbInboundItem.id
|
||||||
|
client['clientId'] = this.getClientId(dbInbound.protocol, client)
|
||||||
|
response.inbounds.push(dbInboundItem.id)
|
||||||
|
response.clients.push(client)
|
||||||
|
response.editIds.push(client['clientId'])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
},
|
||||||
getClientId(protocol, client) {
|
getClientId(protocol, client) {
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
case Protocols.TROJAN: return client.password;
|
case Protocols.TROJAN: return client.password;
|
||||||
|
|
Loading…
Reference in a new issue