1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-02-12 10:31:52 +00:00

Fix Shadowsocks Rust stats error

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-03-24 21:35:51 +01:00
parent f6e6f218d1
commit f974719ddc
2 changed files with 10 additions and 3 deletions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
omr-vps-admin (0.9+20240324) unstable; urgency=medium
* Fix Shadowsocks Rust stats error
-- OpenMPTCProuter <contact@openmptcprouter.com> Sun, 24 Mar 2024 21:35:13 +0200
omr-vps-admin (0.9+20240322) unstable; urgency=medium
* Fix OpenVPN stats

View file

@ -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):