From 6434809f0647c743022941b2f159894dd134b919 Mon Sep 17 00:00:00 2001 From: Bryan Gerlach Date: Sat, 30 Mar 2024 18:32:27 -0500 Subject: [PATCH] reverse the sorting to put online up top --- api/views_front.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/views_front.py b/api/views_front.py index 50a9a4a..55ad446 100644 --- a/api/views_front.py +++ b/api/views_front.py @@ -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