Skip to content

Commit

Permalink
Update task_manager_index.py
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Jun 3, 2024
1 parent 4bb9d0f commit 10c7ec8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugins/task_manager/task_manager_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,12 +717,14 @@ def get_process_list_linux(self, get = {}):
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'
Expand Down Expand Up @@ -784,8 +786,8 @@ def get_process_list_linux(self, get = {}):
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'],
Expand Down

0 comments on commit 10c7ec8

Please sign in to comment.