Skip to content

Commit

Permalink
Fix Xray traffic stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Sep 29, 2023
1 parent c95c595 commit 4e78d8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
omr-vps-admin (0.4+20230929) unstable; urgency=medium

* Fix XRay traffic stats

-- OpenMPTCProuter <[email protected]> Sun, 29 Sep 2023 14:23:59 +0200

omr-vps-admin (0.4+20230927) unstable; urgency=medium

* Add XRay support
Expand Down
2 changes: 1 addition & 1 deletion omr-admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 4e78d8a

Please sign in to comment.