Make the separator default behavor in UI (and add the option in the configuration file

This commit is contained in:
nicolargo 2024-01-07 18:52:22 +01:00
parent fe52a56b6a
commit 309c45036f
7 changed files with 31 additions and 11 deletions

View File

@ -20,8 +20,10 @@ history_size=1200
##############################################################################
[outputs]
# Theme name for the Curses interface: black or white
# Theme name (for the moment only for the Curses interface: black or white)
curse_theme=black
# Separator in the Curses and WebUI interface (between top and others plugins)
separator=True
# Limit the number of processes to display (for the WebUI)
max_processes_display=25
# Set the URL prefix (for the WebUI and the API)

View File

@ -22,6 +22,8 @@ history_size=1200
[outputs]
# Theme name for the Curses interface: black or white
curse_theme=black
# Separator in the Curses and WebUI interface (between top and others plugins)
separator=True
# Limit the number of processes to display (for the WebUI)
max_processes_display=25
# Set the URL prefix (for the WebUI and the API)

View File

@ -244,12 +244,11 @@ Examples of use:
help='enable extended stats on top process',
)
parser.add_argument(
'--separator',
'--enable-separator',
action='store_true',
default=False,
'--disable-separator',
action='store_false',
default=True,
dest='enable_separator',
help='enable separator in the UI',
help='disable separator in the UI (between top and others modules)',
),
parser.add_argument(
'--disable-cursor',

View File

@ -201,7 +201,7 @@ class _GlancesCurses(object):
if config is not None and config.has_section('outputs'):
logger.debug('Read the outputs section in the configuration file')
self.theme['name'] = config.get_value('outputs', 'curse_theme', default='black')
logger.debug('Theme for the curse interface: {}'.format(self.theme['name']))
self.args.enable_separator = config.get_bool_value('outputs', 'separator', default=True)
def is_theme(self, name):
"""Return True if the theme *name* should be used."""
@ -596,7 +596,7 @@ class _GlancesCurses(object):
self.column = self.next_column
def separator_line(self, color='SEPARATOR'):
"""New separator line in the curses interface."""
"""Add a separator line in the curses interface."""
if not self.args.enable_separator:
return
self.new_line()

View File

@ -69,6 +69,21 @@ body {
padding-left: 10px;
}
.separator {
overflow:hidden;
height:5px;
}
.separator:after {
content:'';
display:block;
margin:-25px auto 0;
width:100%;
height:24px;
border-radius:125px / 12px;
box-shadow:0 0 8px #555555;
}
/* Theme */
.title {

View File

@ -28,6 +28,7 @@
</div>
</div>
</div>
<div class="row separator" v-if="args.enable_separator"></div>
<div class="row">
<div class="hidden-xs hidden-sm hidden-md col-lg-6" v-if="!args.disable_quicklook">
<glances-plugin-quicklook :data="data"></glances-plugin-quicklook>
@ -58,6 +59,7 @@
<glances-plugin-load :data="data"></glances-plugin-load>
</div>
</div>
<div class="row separator" v-if="args.enable_separator"></div>
</div>
<div class="container-fluid">
<div class="row">

File diff suppressed because one or more lines are too long