mirror of https://github.com/nicolargo/glances.git
Issue when display sensors with space in browser #2983
This commit is contained in:
parent
cd70a8091f
commit
64e8cf4221
|
|
@ -541,7 +541,7 @@ disable=False
|
|||
# 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,sensors:value:Ambient,sensors:value:Composite
|
||||
columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:Ambient 5
|
||||
columns=system:hr_name,load:min5,cpu:total,mem:percent,memswap:percent,sensors:value:dell_smm 0
|
||||
# Define the static servers list
|
||||
# _protocol can be: rpc (default if not defined) or rest
|
||||
# List is limited to 256 servers max (1 to 256)
|
||||
|
|
|
|||
|
|
@ -314,8 +314,11 @@ class GlancesCursesBrowser(_GlancesCurses):
|
|||
stats_max = screen_y - 3
|
||||
y = 2
|
||||
xc = x + 2
|
||||
# First line (plugin name)
|
||||
for k, v in column_def.items():
|
||||
logger.info(k)
|
||||
k_split = k.split('_')
|
||||
logger.info(k_split)
|
||||
if len(k_split) == 1:
|
||||
xc += v + self.space_between_column
|
||||
continue
|
||||
|
|
@ -324,12 +327,11 @@ class GlancesCursesBrowser(_GlancesCurses):
|
|||
xc += v + self.space_between_column
|
||||
xc = x + 2
|
||||
y += 1
|
||||
# Second line (for item/key)
|
||||
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[len(k_split) - 1].upper(), screen_x - x, self.colors_list['BOLD']
|
||||
)
|
||||
self.term_window.addnstr(y, xc, ' '.join(k_split[1:]).upper(), screen_x - x, self.colors_list['BOLD'])
|
||||
xc += v + self.space_between_column
|
||||
y += 1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue