From 10c7ec8718351bcb50d30124bfdada4bec9716d9 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 4 Jun 2024 03:32:34 +0800 Subject: [PATCH] Update task_manager_index.py --- plugins/task_manager/task_manager_index.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/task_manager/task_manager_index.py b/plugins/task_manager/task_manager_index.py index 1536d51a5..896a5e9a7 100755 --- a/plugins/task_manager/task_manager_index.py +++ b/plugins/task_manager/task_manager_index.py @@ -717,12 +717,14 @@ class mainClass(object): self.new_info['time'] = time.time() self.get_process_net_list() - sortx = 'all' - if 'sortx' in get: sortx = get['sortx'] if not 'sortx' in get: - get['sortx'] = 'status' - if get['sortx'] == 'status': res = False + get['sortx'] = 'all' + + res = True + if get['sortx'] == 'status': + res = False + if 'reverse' in get: if get['reverse'] in ['undefined', 'null']: get['reverse'] = 'True' @@ -784,8 +786,8 @@ class mainClass(object): continue processList = self.__pro_s_s(processList) - res = True - if sortx not in ['all']: + + if get['sortx'] not in ['all']: processList = sorted(processList, key=lambda x: x[get['sortx']], reverse=res) else: processList = sorted(processList, key=lambda x: [x['cpu_percent'], x['up'], x['down'], x['io_write_speed'],