diff options
author | nicolargo <nicolas@nicolargo.com> | 2021-06-19 08:03:37 +0200 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2021-06-19 08:03:37 +0200 |
commit | d915a64fa359ef6bc9d6b31cca1d9d34f6c6143e (patch) | |
tree | 82be8a71e0f160e8c33fc1d37a11b412eccad9b2 | |
parent | 153ce376bd04ce4fc8669a4fdbdf840a01edeb0b (diff) |
Sparkline not working in server/client mode #1881 - For the moment disable sparkline in client mode
-rw-r--r-- | docs/aoa/quicklook.rst | 5 | ||||
-rw-r--r-- | glances/plugins/glances_docker.py | 5 | ||||
-rw-r--r-- | glances/plugins/glances_plugin.py | 4 | ||||
-rw-r--r-- | glances/plugins/glances_quicklook.py | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/docs/aoa/quicklook.rst b/docs/aoa/quicklook.rst index b3d089b8..42df8e78 100644 --- a/docs/aoa/quicklook.rst +++ b/docs/aoa/quicklook.rst @@ -17,8 +17,9 @@ If the per CPU mode is on (by clicking the ``1`` key): In the Curses/terminal interface, it is also possible to switch from bar to sparkline using 'S' hot key or --sparkline command line option (need the sparklines Python lib on your system). Please be aware that sparklines use -the Glances history and will not be available if the history is disabled from -the command line. +the Glances history and will not be available if the history is disabled +from the command line. For the moment sparkline is not available in +client/server mode. .. image:: ../_static/sparkline.png diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py index e3791424..77e250e4 100644 --- a/glances/plugins/glances_docker.py +++ b/glances/plugins/glances_docker.py @@ -575,7 +575,10 @@ class Plugin(GlancesPlugin): ret.append(self.curse_new_line()) # Get the maximum containers name # Max size is configurable. See feature request #1723. - name_max_width = min(self.config.get_int_value('docker', 'max_name_size', default=20), + name_max_width = min(self.config.get_int_value('docker', + 'max_name_size', + default=20) + if self.config is not None else 20, len(max(self.stats['containers'], key=lambda x: len(x['name']))['name'])) msg = ' {:{width}}'.format('Name', width=name_max_width) diff --git a/glances/plugins/glances_plugin.py b/glances/plugins/glances_plugin.py index 75b1be5b..10ad6f12 100644 --- a/glances/plugins/glances_plugin.py +++ b/glances/plugins/glances_plugin.py @@ -164,7 +164,9 @@ class GlancesPlugin(object): return json.dumps(d, ensure_ascii=False) def history_enable(self): - return self.args is not None and not self.args.disable_history and self.get_items_history_list() is not None + return self.args is not None and \ + not self.args.disable_history and \ + self.get_items_history_list() is not None def init_stats_history(self): """Init the stats history (dict of GlancesAttribute).""" diff --git a/glances/plugins/glances_quicklook.py b/glances/plugins/glances_quicklook.py index 45b19523..067bd7ca 100644 --- a/glances/plugins/glances_quicklook.py +++ b/glances/plugins/glances_quicklook.py @@ -116,7 +116,7 @@ class Plugin(GlancesPlugin): # Define the data: Bar (default behavor) or Sparkline sparkline_tag = False - if self.args.sparkline and self.history_enable(): + if self.args.sparkline and self.history_enable() and not self.args.client: data = Sparkline(max_width) sparkline_tag = data.available if not sparkline_tag: |