mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-03-09 15:40:05 +00:00
Fix Shadowsocks Rust stats error
This commit is contained in:
parent
f6e6f218d1
commit
f974719ddc
2 changed files with 10 additions and 3 deletions
|
@ -171,9 +171,10 @@ def get_bytes_ss_go(user):
|
|||
return { 'downlinkBytes': 0, 'uplinkBytes': 0 }
|
||||
if 'error' in r.json():
|
||||
return { 'downlinkBytes': 0, 'uplinkBytes': 0 }
|
||||
for userdata in r.json()['users']:
|
||||
if userdata['username'] == user:
|
||||
return { 'downlinkBytes': userdata['downlinkBytes'], 'uplinkBytes': userdata['uplinkBytes'] }
|
||||
if 'users' in r.json():
|
||||
for userdata in r.json()['users']:
|
||||
if userdata['username'] == user:
|
||||
return { 'downlinkBytes': userdata['downlinkBytes'], 'uplinkBytes': userdata['uplinkBytes'] }
|
||||
return { 'downlinkBytes': 0, 'uplinkBytes': 0 }
|
||||
|
||||
def get_bytes_v2ray(t,user):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue