3x-ui/web/service
BlacKSnowDot0 938417943d
Update inbound.go
checkPortExist Function:
Simplified the query by combining the conditions into a single Where clause.
Removed unnecessary variable assignment for db.

checkEmailExistForInbound Function:
Introduced a map seenEmails to track already seen emails, which eliminates the need for the contains function call for each client email, thus reducing the complexity from O(n^2) to O(n).

UpdateInbound Function:
Instead of manually assigning each field, a map updates is used to update only the changed fields in the database. This reduces the verbosity of the code and makes it easier to maintain.
Removed the unnecessary API calls for adding and deleting inbounds, as the function should only update the database record.

addClientTraffic Function:
Streamlined the update process by directly updating the traffic records in the database using a loop, which avoids the need to first load all records into a slice and then adjust them.
2023-11-19 17:50:41 -08:00
..
config.json remove iran.dat 2023-10-18 13:22:07 +03:30
inbound.go Update inbound.go 2023-11-19 17:50:41 -08:00
panel.go 3x-ui 2023-02-09 22:48:06 +03:30
server.go remove iran.dat 2023-10-18 13:22:07 +03:30
setting.go Add encrypt subscription ON/OFF switch 2023-08-26 16:54:01 +03:30
tgbot.go fixed telego 2023-10-25 23:03:17 +03:30
user.go secret token thanks to @HarlyquinForest 2023-04-21 19:00:14 +03:30
xray.go [db] Enbancement add traffic fully transactional 2023-08-26 15:19:51 +03:30