Skip to content

Commit

Permalink
Showing the full arguments on the command column of the TASKS Section…
Browse files Browse the repository at this point in the history
… of the Web UI. #2634
  • Loading branch information
nicolargo committed Dec 29, 2023
1 parent fa0fc85 commit 85481da
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 46 deletions.
4 changes: 0 additions & 4 deletions glances/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,6 @@ def init_client_server(self, args):
if args.disable_autodiscover:
logger.info("Auto discover mode is disabled")

# In web server mode
if args.webserver:
args.process_short_name = True

# Server or client login/password
if args.username_prompt:
# Every username needs a password
Expand Down
8 changes: 4 additions & 4 deletions glances/outputs/static/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ body {
display: table-cell;
text-align: right;
}
.width-50 {
width: 50px;
.width-60 {
width: 60px;
}
.width-75 {
width: 75px;
.width-80 {
width: 80px;
}
.width-100 {
width: 100px;
Expand Down
2 changes: 1 addition & 1 deletion glances/outputs/static/js/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export default {
});
// SLASH => Enable/disable short processes name
hotkeys('/', () => {
hotkeys('shift+S', () => {
this.store.args.process_short_name = !this.store.args.process_short_name;
});
Expand Down
52 changes: 26 additions & 26 deletions glances/outputs/static/js/components/plugin-processlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<section id="processlist-plugin" class="plugin">
<div class="table">
<div class="table-row">
<div class="table-cell width-50" :class="['sortable', sorter.column === 'cpu_percent' && 'sort']"
<div class="table-cell width-60" :class="['sortable', sorter.column === 'cpu_percent' && 'sort']"
@click="$emit('update:sorter', 'cpu_percent')">
CPU%
</div>
<div class="table-cell width-50" :class="['sortable', sorter.column === 'memory_percent' && 'sort']"
<div class="table-cell width-60" :class="['sortable', sorter.column === 'memory_percent' && 'sort']"
@click="$emit('update:sorter', 'memory_percent')">
MEM%
</div>
<div class="table-cell width-75 hidden-xs hidden-sm">VIRT</div>
<div class="table-cell width-75 hidden-xs hidden-sm">RES</div>
<div class="table-cell width-75">PID</div>
<div class="table-cell width-80 hidden-xs hidden-sm">VIRT</div>
<div class="table-cell width-80 hidden-xs hidden-sm">RES</div>
<div class="table-cell width-80">PID</div>
<div class="table-cell width-100 text-left" :class="['sortable', sorter.column === 'username' && 'sort']"
@click="$emit('update:sorter', 'username')">
USER
Expand All @@ -23,19 +23,19 @@
@click="$emit('update:sorter', 'timemillis')">
TIME+
</div>
<div class="table-cell width-75 text-left hidden-xs hidden-sm"
<div class="table-cell width-80 text-left hidden-xs hidden-sm"
:class="['sortable', sorter.column === 'num_threads' && 'sort']"
@click="$emit('update:sorter', 'num_threads')">
THR
</div>
<div class="table-cell width-50">NI</div>
<div class="table-cell width-50">S</div>
<div v-show="ioReadWritePresent" class="table-cell width-75 hidden-xs hidden-sm"
<div class="table-cell width-60">NI</div>
<div class="table-cell width-60">S</div>
<div v-show="ioReadWritePresent" class="table-cell width-80 hidden-xs hidden-sm"
:class="['sortable', sorter.column === 'io_counters' && 'sort']"
@click="$emit('update:sorter', 'io_counters')">
IOR/s
</div>
<div v-show="ioReadWritePresent" class="table-cell width-75 text-left hidden-xs hidden-sm"
<div v-show="ioReadWritePresent" class="table-cell width-80 text-left hidden-xs hidden-sm"
:class="['sortable', sorter.column === 'io_counters' && 'sort']"
@click="$emit('update:sorter', 'io_counters')">
IOW/s
Expand All @@ -46,19 +46,19 @@
</div>
</div>
<div class="table-row" v-for="(process, processId) in processes" :key="processId">
<div class="table-cell width-50" :class="getCpuPercentAlert(process)">
<div class="table-cell width-60" :class="getCpuPercentAlert(process)">
{{ process.cpu_percent == -1 ? '?' : $filters.number(process.cpu_percent, 1) }}
</div>
<div class="table-cell width-50" :class="getMemoryPercentAlert(process)">
<div class="table-cell width-60" :class="getMemoryPercentAlert(process)">
{{ process.memory_percent == -1 ? '?' : $filters.number(process.memory_percent, 1) }}
</div>
<div class="table-cell width-75">
<div class="table-cell width-80">
{{ $filters.bytes(process.memvirt) }}
</div>
<div class="table-cell width-75">
<div class="table-cell width-80">
{{ $filters.bytes(process.memres) }}
</div>
<div class="table-cell width-75">
<div class="table-cell width-80">
{{ process.pid }}
</div>
<div class="table-cell width-100 text-left">
Expand All @@ -71,20 +71,20 @@
<span v-show="process.timeplus.hours <= 0">.{{ $filters.leftPad(process.timeplus.milliseconds, 2, '0')
}}</span>
</div>
<div class="table-cell width-75 hidden-xs hidden-sm" v-if="process.timeplus == '?'">?</div>
<div class="table-cell width-75 text-left hidden-xs hidden-sm">
<div class="table-cell width-80 hidden-xs hidden-sm" v-if="process.timeplus == '?'">?</div>
<div class="table-cell width-80 text-left hidden-xs hidden-sm">
{{ process.num_threads == -1 ? '?' : process.num_threads }}
</div>
<div class="table-cell width-50" :class="{ nice: process.isNice }">
<div class="table-cell width-60" :class="{ nice: process.isNice }">
{{ $filters.exclamation(process.nice) }}
</div>
<div class="table-cell width-50" :class="{ status: process.status == 'R' }">
<div class="table-cell width-60" :class="{ status: process.status == 'R' }">
{{ process.status }}
</div>
<div class="table-cell width-75 hidden-xs hidden-sm" v-show="ioReadWritePresent">
<div class="table-cell width-80 hidden-xs hidden-sm" v-show="ioReadWritePresent">
{{ $filters.bytes(process.io_read) }}
</div>
<div class="table-cell width-75 text-left hidden-xs hidden-sm" v-show="ioReadWritePresent">
<div class="table-cell width-80 text-left hidden-xs hidden-sm" v-show="ioReadWritePresent">
{{ $filters.bytes(process.io_write) }}
</div>
<div class="table-cell text-left" v-show="args.process_short_name">
Expand Down Expand Up @@ -139,6 +139,10 @@ export default {
process.memres = process.memory_info.rss;
}
if (isWindows && process.username !== null) {
process.username = last(process.username.split('\\'));
}
process.timeplus = '?';
process.timemillis = '?';
if (process.cpu_times) {
Expand Down Expand Up @@ -178,14 +182,10 @@ export default {
process.cmdline = process.cmdline.join(' ').replace(/\n/g, ' ');
}
if (process.cmdline === null) {
if (process.cmdline === null || process.cmdline.length === 0) {
process.cmdline = process.name;
}
if (isWindows && process.username !== null) {
process.username = last(process.username.split('\\'));
}
return process;
});
Expand Down
4 changes: 2 additions & 2 deletions glances/outputs/static/public/glances.js

Large diffs are not rendered by default.

29 changes: 20 additions & 9 deletions glances/plugins/help/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self, args=None, config=None):

# Set the config instance
self.config = config
self.args = args

# We want to display the stat in the curse interface
self.display_curse = True
Expand Down Expand Up @@ -105,22 +106,32 @@ def generate_view_data(self):
('toggle_linux_percentage', msg_col.format('0', 'Load, Linux/percentage')),
('toggle_cpu_individual_combined', msg_col.format('1', 'CPU, individual/combined')),
('toggle_gpu_individual_combined', msg_col.format('6', 'GPU, individual/combined')),
('toggle_short_full', msg_col.format('/', 'Process names, short/full')),
('toggle_short_full',
msg_col.format('S',
'Process names, short/full') if self.args.webserver else msg_col.format('/', 'Process names, short/full')),
('header_miscellaneous', msg_header.format('MISCELLANEOUS:')),
('misc_erase_process_filter', msg_col.format('E', 'Erase process filter')),
('misc_generate_history_graphs', msg_col.format('g', 'Generate history graphs')),
('misc_erase_process_filter',
'' if self.args.webserver else msg_col.format('E', 'Erase process filter')),
('misc_generate_history_graphs',
'' if self.args.webserver else msg_col.format('g', 'Generate history graphs')),
('misc_help', msg_col.format('h', 'HELP')),
('misc_accumulate_processes_by_program', msg_col.format('j', 'Display threads or programs')),
('misc_accumulate_processes_by_program',
'' if self.args.webserver else msg_col.format('j', 'Display threads or programs')),
('misc_increase_nice_process', msg_col.format('+', 'Increase nice process')),
('misc_decrease_nice_process', msg_col.format('-', 'Decrease nice process (need admin rights)')),
('misc_kill_process', msg_col.format('k', 'Kill process')),
('misc_reset_processes_summary_min_max', msg_col.format('M', 'Reset processes summary min/max')),
('misc_quit', msg_col.format('q', 'QUIT (or Esc or Ctrl-C)')),
('misc_kill_process',
'' if self.args.webserver else msg_col.format('k', 'Kill process')),
('misc_reset_processes_summary_min_max',
'' if self.args.webserver else msg_col.format('M', 'Reset processes summary min/max')),
('misc_quit',
'' if self.args.webserver else msg_col.format('q', 'QUIT (or Esc or Ctrl-C)')),
('misc_reset_history', msg_col.format('r', 'Reset history')),
('misc_delete_warning_alerts', msg_col.format('w', 'Delete warning alerts')),
('misc_delete_warning_and_critical_alerts', msg_col.format('x', 'Delete warning & critical alerts')),
('misc_theme_white', msg_col.format('9', 'Optimize colors for white background')),
('misc_edit_process_filter_pattern', ' ENTER: Edit process filter pattern'),
('misc_theme_white',
'' if self.args.webserver else msg_col.format('9', 'Optimize colors for white background')),
('misc_edit_process_filter_pattern',
'' if self.args.webserver else ' ENTER: Edit process filter pattern'),
]
)

Expand Down

0 comments on commit 85481da

Please sign in to comment.