Skip to content

Commit

Permalink
changed offline to X, sorting isn't reversed anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
bryangerlach committed Mar 30, 2024
1 parent 6434809 commit 511109d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/views_front.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ def get_all_info():
devices[peer.rid]['rust_user'] = user.username

for k, v in devices.items():
devices[k]['status'] = _('Online') if (now-datetime.datetime.strptime(v['update_time'], '%Y-%m-%d %H:%M')).seconds <=120 else _('Offline')
sorted_devices = sorted(devices.items(), key=custom_sort, reverse=True)
devices[k]['status'] = _('Online') if (now-datetime.datetime.strptime(v['update_time'], '%Y-%m-%d %H:%M')).seconds <=120 else _('X')
sorted_devices = sorted(devices.items(), key=custom_sort)
new_ordered_dict = {}
for key, device in sorted_devices:
new_ordered_dict[key] = device
Expand Down

0 comments on commit 511109d

Please sign in to comment.