mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-29 20:21:35 +03:00
Add 'PROCESS' and 'STATUS' decorations
It's now possible to define specific colors for both process name and process status.
This commit is contained in:
parent
15ea33461f
commit
29fdeec161
@ -131,6 +131,8 @@ class glancesCurses:
|
|||||||
'SORT': A_BOLD,
|
'SORT': A_BOLD,
|
||||||
'OK': self.default_color2,
|
'OK': self.default_color2,
|
||||||
'TITLE': self.title_color,
|
'TITLE': self.title_color,
|
||||||
|
'PROCESS': self.default_color2,
|
||||||
|
'STATUS': self.default_color2,
|
||||||
'CAREFUL': self.ifCAREFUL_color2,
|
'CAREFUL': self.ifCAREFUL_color2,
|
||||||
'WARNING': self.ifWARNING_color2,
|
'WARNING': self.ifWARNING_color2,
|
||||||
'CRITICAL': self.ifCRITICAL_color2,
|
'CRITICAL': self.ifCRITICAL_color2,
|
||||||
|
@ -219,6 +219,8 @@ class GlancesPlugin(object):
|
|||||||
UNDERLINE: underline
|
UNDERLINE: underline
|
||||||
BOLD: bold
|
BOLD: bold
|
||||||
TITLE: for stat title
|
TITLE: for stat title
|
||||||
|
PROCESS: for process name
|
||||||
|
STATUS: for process status
|
||||||
OK: Value is OK and non logged
|
OK: Value is OK and non logged
|
||||||
OK_LOG: Value is OK and logged
|
OK_LOG: Value is OK and logged
|
||||||
CAREFUL: Value is CAREFUL and non logged
|
CAREFUL: Value is CAREFUL and non logged
|
||||||
|
@ -141,7 +141,7 @@ class Plugin(GlancesPlugin):
|
|||||||
status = p['status']
|
status = p['status']
|
||||||
msg = " {0:>1}".format(status)
|
msg = " {0:>1}".format(status)
|
||||||
if status == 'R':
|
if status == 'R':
|
||||||
ret.append(self.curse_add_line(msg, decoration='OK', optional=True))
|
ret.append(self.curse_add_line(msg, decoration='STATUS', optional=True))
|
||||||
else:
|
else:
|
||||||
ret.append(self.curse_add_line(msg, optional=True))
|
ret.append(self.curse_add_line(msg, optional=True))
|
||||||
# TIME+
|
# TIME+
|
||||||
@ -195,14 +195,12 @@ class Plugin(GlancesPlugin):
|
|||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
msg = " {0}".format(path) + os.sep
|
msg = " {0}".format(path) + os.sep
|
||||||
ret.append(self.curse_add_line(msg, optional=True, splittable=True))
|
ret.append(self.curse_add_line(msg, optional=True, splittable=True))
|
||||||
ret.append(self.curse_add_line(basename, decoration='OK', optional=True, splittable=True))
|
ret.append(self.curse_add_line(basename, decoration='PROCESS', optional=True, splittable=True))
|
||||||
msg = " {0}".format(args)
|
|
||||||
ret.append(self.curse_add_line(msg, optional=True, splittable=True))
|
|
||||||
else:
|
else:
|
||||||
msg = " {0}".format(basename)
|
msg = " {0}".format(basename)
|
||||||
ret.append(self.curse_add_line(msg, decoration='OK', optional=True, splittable=True))
|
ret.append(self.curse_add_line(msg, decoration='PROCESS', optional=True, splittable=True))
|
||||||
msg = " {0}".format(args)
|
msg = " {0}".format(args)
|
||||||
ret.append(self.curse_add_line(msg, optional=True, splittable=True))
|
ret.append(self.curse_add_line(msg, optional=True, splittable=True))
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
ret.append(self.curse_add_line("", optional=True, splittable=True))
|
ret.append(self.curse_add_line("", optional=True, splittable=True))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user