Skip to content

Commit

Permalink
reverse the sorting to put online up top
Browse files Browse the repository at this point in the history
  • Loading branch information
bryangerlach committed Mar 30, 2024
1 parent 363a0ee commit 6434809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/views_front.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def get_all_info():

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)
sorted_devices = sorted(devices.items(), key=custom_sort, reverse=True)
new_ordered_dict = {}
for key, device in sorted_devices:
new_ordered_dict[key] = device
Expand Down

0 comments on commit 6434809

Please sign in to comment.