mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-02-12 10:31:52 +00:00
Fix Xray traffic stats
This commit is contained in:
parent
c95c595577
commit
4e78d8a259
2 changed files with 7 additions and 1 deletions
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,3 +1,9 @@
|
|||
omr-vps-admin (0.4+20230929) unstable; urgency=medium
|
||||
|
||||
* Fix XRay traffic stats
|
||||
|
||||
-- OpenMPTCProuter <contact@openmptcprouter.com> Sun, 29 Sep 2023 14:23:59 +0200
|
||||
|
||||
omr-vps-admin (0.4+20230927) unstable; urgency=medium
|
||||
|
||||
* Add XRay support
|
||||
|
|
|
@ -150,7 +150,7 @@ def get_bytes_xray(t,user):
|
|||
else:
|
||||
side="uplink"
|
||||
try:
|
||||
data = subprocess.check_output('/usr/bin/xray api stats --server=127.0.0.1:10086 -json ' + "'" + 'user>>>' + user + '>>>traffic>>>' + side + "'" + ' 2>/dev/null | jq -r .stat[0].value | tr -d " " | tr -d "\n"', shell = True)
|
||||
data = subprocess.check_output('/usr/bin/xray api stats --server=127.0.0.1:10086 -name ' + "'" + 'user>>>' + user + '>>>traffic>>>' + side + "'" + ' 2>/dev/null | jq -r .stat.value | tr -d " " | tr -d "\n"', shell = True)
|
||||
except:
|
||||
return 0
|
||||
if data.decode("utf-8") != '' and data.decode("utf-8") != 'null':
|
||||
|
|
Loading…
Reference in a new issue