diff --git a/conf/glances.conf b/conf/glances.conf index e9e43286b..d84072785 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -525,7 +525,7 @@ disable=False # Define columns (comma separated list of ::()) to grab/display # Default is: system:hr_name,load:min5,cpu:total,mem:percent # You can also add stats with key, like sensors:value:Ambient (key is case sensitive) -#columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent +#columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:Ambient,sensors:value:Composite # Define the static servers list #server_1_name=localhost #server_1_alias=My local PC diff --git a/docker-compose/glances.conf b/docker-compose/glances.conf index 8afa70fc5..437411ba9 100755 --- a/docker-compose/glances.conf +++ b/docker-compose/glances.conf @@ -525,7 +525,7 @@ disable=False # Define columns (comma separated list of ::()) to grab/display # Default is: system:hr_name,load:min5,cpu:total,mem:percent # You can also add stats with key, like sensors:value:Ambient (key is case sensitive) -#columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent +#columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:Ambient,sensors:value:Composite # Define the static servers list #server_1_name=localhost #server_1_alias=My local PC diff --git a/glances/client_browser.py b/glances/client_browser.py index 6b210b9ff..47bd6645d 100644 --- a/glances/client_browser.py +++ b/glances/client_browser.py @@ -93,7 +93,9 @@ def __update_stats(self, server): # Get the stats for column in self.static_server.get_columns(): - server_key = column['plugin'] + '_' + column['field'] + server_key = column.get('plugin') + '_' + column.get('field') + if 'key' in column: + server_key += '_' + column.get('key') try: # Value v_json = json_loads(s.getPlugin(column['plugin'])) diff --git a/glances/outputs/glances_curses_browser.py b/glances/outputs/glances_curses_browser.py index 81af4febc..1bc2e8aff 100644 --- a/glances/outputs/glances_curses_browser.py +++ b/glances/outputs/glances_curses_browser.py @@ -315,8 +315,21 @@ def __display_server_list(self, stats, x, y, screen_x, screen_y): y = 2 xc = x + 2 for k, v in column_def.items(): + k_split = k.split('_') + if len(k_split) == 1: + xc += v + self.space_between_column + continue + if xc < screen_x and y < screen_y and v is not None: + self.term_window.addnstr(y, xc, k_split[0].upper(), screen_x - x, self.colors_list['BOLD']) + xc += v + self.space_between_column + xc = x + 2 + y += 1 + for k, v in column_def.items(): + k_split = k.split('_') if xc < screen_x and y < screen_y and v is not None: - self.term_window.addnstr(y, xc, k.split('_')[0].upper(), screen_x - x, self.colors_list['BOLD']) + self.term_window.addnstr( + y, xc, k_split[len(k_split) - 1].upper(), screen_x - x, self.colors_list['BOLD'] + ) xc += v + self.space_between_column y += 1