mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-03-09 15:40:05 +00:00
Fix Xray traffic stats
This commit is contained in:
parent
c95c595577
commit
4e78d8a259
2 changed files with 7 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue