Skip to content

Commit

Permalink
Fix Shadowsocks Rust stats error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Mar 24, 2024
1 parent f6e6f21 commit f974719
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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.9+20240324) unstable; urgency=medium

* Fix Shadowsocks Rust stats error

-- OpenMPTCProuter <[email protected]> Sun, 24 Mar 2024 21:35:13 +0200

omr-vps-admin (0.9+20240322) unstable; urgency=medium

* Fix OpenVPN stats
Expand Down
7 changes: 4 additions & 3 deletions omr-admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f974719

Please sign in to comment.