mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-04 16:03:52 +03:00
Sparkline not working in server/client mode #1881 - For the moment disable sparkline in client mode
This commit is contained in:
parent
153ce376bd
commit
d915a64fa3
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)."""
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user