Reformat help display

pull/2075/head
FastThenLeft 2022-07-04 20:35:48 -04:00
parent 5ec14a5be3
commit 5ddf57e3f5
1 changed files with 118 additions and 109 deletions

View File

@ -52,60 +52,67 @@ class Plugin(GlancesPlugin):
except AttributeError:
pass
msg_col = ' {0:1} {1:35}'
msg_col2 = ' {0:1} {1:35}'
self.view_data['sort_auto'] = msg_col.format('a', 'Sort processes automatically')
self.view_data['sort_network'] = msg_col2.format('b', 'Bytes or bits for network I/O')
self.view_data['sort_cpu'] = msg_col.format('c', 'Sort processes by CPU%')
self.view_data['show_hide_alert'] = msg_col2.format('l', 'Show/hide alert logs')
self.view_data['sort_mem'] = msg_col.format('m', 'Sort processes by MEM%')
self.view_data['sort_user'] = msg_col.format('u', 'Sort processes by USER')
self.view_data['delete_warning_alerts'] = msg_col2.format('w', 'Delete warning alerts')
self.view_data['sort_proc'] = msg_col.format('p', 'Sort processes by name')
self.view_data['delete_warning_critical_alerts'] = msg_col2.format('x', 'Delete warning and critical alerts')
self.view_data['sort_io'] = msg_col.format('i', 'Sort processes by I/O rate')
self.view_data['percpu'] = msg_col2.format('1', 'Global CPU or per-CPU stats')
self.view_data['sort_cpu_times'] = msg_col.format('t', 'Sort processes by TIME')
self.view_data['show_hide_help'] = msg_col2.format('h', 'Show/hide this help screen')
self.view_data['show_hide_diskio'] = msg_col.format('d', 'Show/hide disk I/O stats')
self.view_data['show_hide_irq'] = msg_col2.format('Q', 'Show/hide IRQ stats')
self.view_data['view_network_io_combination'] = msg_col2.format('T', 'View network I/O as combination')
self.view_data['show_hide_filesystem'] = msg_col.format('f', 'Show/hide filesystem stats')
self.view_data['view_cumulative_network'] = msg_col2.format('U', 'View cumulative network I/O')
self.view_data['show_hide_network'] = msg_col.format('n', 'Show/hide network stats')
self.view_data['show_hide_time'] = msg_col.format('N', 'Show/hide current time')
self.view_data['show_hide_filesytem_freespace'] = msg_col2.format('F', 'Show filesystem free space')
self.view_data['show_hide_sensors'] = msg_col.format('s', 'Show/hide sensors stats')
self.view_data['generate_graphs'] = msg_col2.format('g', 'Generate graphs for current history')
self.view_data['show_hide_left_sidebar'] = msg_col.format('2', 'Show/hide left sidebar')
self.view_data['reset_history'] = msg_col2.format('r', 'Reset history')
self.view_data['enable_disable_process_stats'] = msg_col.format('z', 'Enable/disable processes stats')
self.view_data['quit'] = msg_col.format('q', 'Quit (Esc and Ctrl-C also work)')
self.view_data['enable_disable_top_extends_stats'] = msg_col.format('e', 'Enable/disable top extended stats')
self.view_data['enable_disable_short_processname'] = msg_col.format('/', 'Enable/disable short processes name')
self.view_data['enable_disable_irix'] = msg_col.format('0', 'Enable/disable Irix process CPU')
self.view_data['enable_disable_docker'] = msg_col2.format('D', 'Enable/disable Docker stats')
self.view_data['enable_disable_quick_look'] = msg_col.format('3', 'Enable/disable quick look plugin')
self.view_data['show_hide_ip'] = msg_col2.format('I', 'Show/hide IP module')
self.view_data['diskio_iops'] = msg_col2.format('B', 'Count/rate for Disk I/O')
self.view_data['show_hide_top_menu'] = msg_col2.format('5', 'Show/hide top menu (QL, CPU, MEM, SWAP and LOAD)')
self.view_data['enable_disable_gpu'] = msg_col.format('G', 'Enable/disable gpu plugin')
self.view_data['enable_disable_mean_gpu'] = msg_col2.format('6', 'Enable/disable mean gpu')
self.view_data['edit_pattern_filter'] = 'ENTER: Edit the process filter pattern'
self.view_data['enable_disable_application_monitor_process'] = msg_col2.format(
'A', 'Enable/disable application monitoring process'
)
self.view_data['erase_current_process_filter'] = msg_col.format('E', 'Erase current process filter')
self.view_data['show_hide_tcp_connection'] = msg_col.format('K', 'Show/hide TCP connections')
self.view_data['kill_process'] = msg_col2.format('k', 'Kill process')
self.view_data['reset_process_summary_min_max'] = msg_col.format('M', 'Reset processes summary min/max')
self.view_data['show_hide_current_time'] = msg_col2.format('N', 'Show/hide current time')
self.view_data['show_hide_raid_plugin'] = msg_col.format('R', 'Show/hide RAID plugin')
self.view_data['show_hide_wifi_module'] = msg_col2.format('W', 'Show/hide Wifi module')
self.view_data['enable_disable_all_but_quick_look_and_load_module'] = msg_col2.format(
'4', 'Enable/disable all but quick look and load module'
)
self.view_data['programs'] = msg_col2.format('j', 'Accumulate processes by program')
msg_col = ' {0:1} {1:34}'
msg_header = '{0:39}'
"""First column"""
self.view_data['header_sort'] = msg_header.format('SORT PROCESSES:')
self.view_data['sort_auto'] = msg_col.format('a', 'Automatically')
self.view_data['sort_cpu'] = msg_col.format('c', 'CPU%')
self.view_data['sort_io_rate'] = msg_col.format('i', 'I/O rate')
self.view_data['sort_mem'] = msg_col.format('m', 'MEM%')
self.view_data['sort_process_name'] = msg_col.format('p', 'Process name')
self.view_data['sort_cpu_times'] = msg_col.format('t', 'TIME')
self.view_data['sort_user'] = msg_col.format('u', 'USER')
self.view_data['header_show_hide'] = msg_header.format('SHOW/HIDE SECTION:')
self.view_data['show_hide_application_monitoring'] = msg_col.format('A', 'Application monitoring')
self.view_data['show_hide_diskio'] = msg_col.format('d', 'Disk I/O')
self.view_data['show_hide_docker'] = msg_col.format('D', 'Docker')
self.view_data['show_hide_top_extended_stats'] = msg_col.format('e', 'Top extended stats')
self.view_data['show_hide_filesystem'] = msg_col.format('f', 'Filesystem')
self.view_data['show_hide_gpu'] = msg_col.format('G', 'GPU')
self.view_data['show_hide_ip'] = msg_col.format('I', 'IP')
self.view_data['show_hide_tcp_connection'] = msg_col.format('K', 'TCP')
self.view_data['show_hide_alert'] = msg_col.format('l', 'Alert logs')
self.view_data['show_hide_network'] = msg_col.format('n', 'Network')
self.view_data['show_hide_current_time'] = msg_col.format('N', 'Time')
self.view_data['show_hide_irq'] = msg_col.format('Q', 'IRQ')
self.view_data['show_hide_raid_plugin'] = msg_col.format('R', 'RAID')
self.view_data['show_hide_sensors'] = msg_col.format('s', 'Sensors')
self.view_data['show_hide_wifi_module'] = msg_col.format('W', 'Wifi')
self.view_data['show_hide_processes'] = msg_col.format('z', 'Processes')
self.view_data['show_hide_left_sidebar'] = msg_col.format('2', 'Left sidebar')
"""Second column"""
self.view_data['show_hide_quick_look'] = msg_col.format('3', 'Quick Look')
self.view_data['show_hide_cpu_mem_swap'] = msg_col.format('4', 'CPU, MEM, and SWAP')
self.view_data['show_hide_all'] = msg_col.format('5', 'ALL')
self.view_data['header_toggle'] = msg_header.format('TOGGLE DATA TYPE:')
self.view_data['toggle_bits_bytes'] = msg_col.format('b', 'Network I/O: bits/bytes')
self.view_data['toggle_count_rate'] = msg_col.format('B', 'Disk I/O: count/rate')
self.view_data['toggle_used_free'] = msg_col.format('F', 'Filesystem space: used/free')
self.view_data['toggle_bar_sparkline'] = msg_col.format('S', 'Quick Look: bar/sparkline')
self.view_data['toggle_separate_combined'] = msg_col.format('T', 'Network I/O: separate/combined')
self.view_data['toggle_live_cumulative'] = msg_col.format('U', 'Network I/O: live/cumulative')
self.view_data['toggle_linux_percentage'] = msg_col.format('0', 'Load: Linux/percentage')
self.view_data['toggle_cpu_individual_combined'] = msg_col.format('1', 'CPU: individual/combined')
self.view_data['toggle_gpu_individual_combined'] = msg_col.format('6', 'GPU: individual/combined')
self.view_data['toggle_short_full'] = msg_col.format('/', 'Process names: short/full')
self.view_data['header_miscellaneous'] = msg_header.format('MISCELLANEOUS:')
self.view_data['misc_erase_process_filter'] = msg_col.format('E', 'Erase process filter')
self.view_data['misc_generate_history_graphs'] = msg_col.format('g', 'Generate history graphs')
self.view_data['misc_help'] = msg_col.format('h', 'HELP')
self.view_data['misc_accumulate processes_by_program'] = msg_col.format('j', 'Accumulate processes by program')
self.view_data['misc_kill_process'] = msg_col.format('k', 'Kill process')
self.view_data['misc_reset_processes_summary_min_max'] = msg_col.format('M', 'Reset processes summary min/max')
self.view_data['misc_quit'] = msg_col.format('q', 'QUIT (or Esc or Ctrl-C)')
self.view_data['misc_reset_history'] = msg_col.format('r', 'Reset history')
self.view_data['misc_delete_warning_alerts'] = msg_col.format('w', 'Delete warning alerts')
self.view_data['misc_delete_warning_and_critical_alerts'] = msg_col.format('x', 'Delete warning & critical alerts')
self.view_data['misc_edit_process_filter_pattern'] = ' ENTER: Edit process filter pattern'
def get_view_data(self, args=None):
"""Return the view."""
@ -116,94 +123,96 @@ class Plugin(GlancesPlugin):
# Init the return message
ret = []
# Build the string message
# Header
# Build the header message
ret.append(self.curse_add_line(self.view_data['version'], 'TITLE'))
ret.append(self.curse_add_line(self.view_data['psutil_version']))
ret.append(self.curse_new_line())
# Configuration file path
# Build the configuration file path
if 'configuration_file' in self.view_data:
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['configuration_file']))
ret.append(self.curse_new_line())
ret.append(self.curse_new_line())
# Keys
ret.append(self.curse_add_line(self.view_data['header_sort']))
ret.append(self.curse_add_line(self.view_data['show_hide_quick_look']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_auto']))
ret.append(self.curse_add_line(self.view_data['sort_network']))
ret.append(self.curse_add_line(self.view_data['show_hide_cpu_mem_swap']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_cpu']))
ret.append(self.curse_add_line(self.view_data['show_hide_alert']))
ret.append(self.curse_add_line(self.view_data['show_hide_all']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_io_rate']))
ret.append(self.curse_add_line(self.view_data['header_toggle']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_mem']))
ret.append(self.curse_add_line(self.view_data['delete_warning_alerts']))
ret.append(self.curse_add_line(self.view_data['toggle_bits_bytes']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_user']))
ret.append(self.curse_add_line(self.view_data['delete_warning_critical_alerts']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_proc']))
ret.append(self.curse_add_line(self.view_data['percpu']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_io']))
ret.append(self.curse_add_line(self.view_data['show_hide_ip']))
ret.append(self.curse_add_line(self.view_data['sort_process_name']))
ret.append(self.curse_add_line(self.view_data['toggle_count_rate']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_cpu_times']))
ret.append(self.curse_add_line(self.view_data['enable_disable_docker']))
ret.append(self.curse_add_line(self.view_data['toggle_used_free']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['sort_user']))
ret.append(self.curse_add_line(self.view_data['toggle_bar_sparkline']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['header_show_hide']))
ret.append(self.curse_add_line(self.view_data['toggle_separate_combined']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_application_monitoring']))
ret.append(self.curse_add_line(self.view_data['toggle_live_cumulative']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_diskio']))
ret.append(self.curse_add_line(self.view_data['view_network_io_combination']))
ret.append(self.curse_add_line(self.view_data['toggle_linux_percentage']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_docker']))
ret.append(self.curse_add_line(self.view_data['toggle_cpu_individual_combined']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_top_extended_stats']))
ret.append(self.curse_add_line(self.view_data['toggle_gpu_individual_combined']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_filesystem']))
ret.append(self.curse_add_line(self.view_data['view_cumulative_network']))
ret.append(self.curse_add_line(self.view_data['toggle_short_full']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_network']))
ret.append(self.curse_add_line(self.view_data['show_hide_filesytem_freespace']))
ret.append(self.curse_add_line(self.view_data['show_hide_gpu']))
ret.append(self.curse_add_line(self.view_data['header_miscellaneous']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_sensors']))
ret.append(self.curse_add_line(self.view_data['generate_graphs']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_left_sidebar']))
ret.append(self.curse_add_line(self.view_data['reset_history']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['enable_disable_process_stats']))
ret.append(self.curse_add_line(self.view_data['show_hide_help']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['enable_disable_quick_look']))
ret.append(self.curse_add_line(self.view_data['diskio_iops']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['enable_disable_top_extends_stats']))
ret.append(self.curse_add_line(self.view_data['show_hide_top_menu']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['enable_disable_short_processname']))
ret.append(self.curse_add_line(self.view_data['show_hide_irq']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['enable_disable_gpu']))
ret.append(self.curse_add_line(self.view_data['enable_disable_mean_gpu']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['enable_disable_irix']))
ret.append(self.curse_add_line(self.view_data['show_hide_wifi_module']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['erase_current_process_filter']))
ret.append(self.curse_add_line(self.view_data['enable_disable_application_monitor_process']))
ret.append(self.curse_add_line(self.view_data['show_hide_ip']))
ret.append(self.curse_add_line(self.view_data['misc_erase_process_filter']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_tcp_connection']))
ret.append(self.curse_add_line(self.view_data['kill_process']))
ret.append(self.curse_add_line(self.view_data['misc_generate_history_graphs']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_alert']))
ret.append(self.curse_add_line(self.view_data['misc_help']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_network']))
ret.append(self.curse_add_line(self.view_data['misc_accumulate processes_by_program']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['reset_process_summary_min_max']))
ret.append(self.curse_add_line(self.view_data['show_hide_current_time']))
ret.append(self.curse_add_line(self.view_data['misc_kill_process']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_irq']))
ret.append(self.curse_add_line(self.view_data['misc_reset_processes_summary_min_max']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_raid_plugin']))
ret.append(self.curse_add_line(self.view_data['enable_disable_all_but_quick_look_and_load_module']))
ret.append(self.curse_add_line(self.view_data['misc_quit']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['quit']))
ret.append(self.curse_add_line(self.view_data['programs']))
ret.append(self.curse_add_line(self.view_data['show_hide_sensors']))
ret.append(self.curse_add_line(self.view_data['misc_reset_history']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_wifi_module']))
ret.append(self.curse_add_line(self.view_data['misc_delete_warning_alerts']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['edit_pattern_filter']))
ret.append(self.curse_add_line(self.view_data['show_hide_processes']))
ret.append(self.curse_add_line(self.view_data['misc_delete_warning_and_critical_alerts']))
ret.append(self.curse_new_line())
ret.append(self.curse_add_line(self.view_data['show_hide_left_sidebar']))
ret.append(self.curse_add_line(self.view_data['misc_edit_process_filter_pattern']))
# Return the message with decoration
return ret