fix: intensive process list is now condensed if small term

This commit is contained in:
Unitech 2019-10-11 15:30:16 +02:00
parent 7a6fe42495
commit 01e95dde92

View File

@ -539,7 +539,7 @@ UX.dispAsTable = function(list, sys_infos) {
var sys_proc_head = ['id', 'cmd', 'pid', 'cpu', 'mem', 'uid']
var sys_proc_table = new Table({
colWidths: [4,77,10,10,10,8],
colWidths: [4, condensed_mode ? 29 : 77, 10, 10, 10, 8],
head : sys_proc_head,
colAligns : ['left'],
style : {'padding-left' : 1, head : ['cyan', 'bold'], compact : true}
@ -554,8 +554,8 @@ UX.dispAsTable = function(list, sys_infos) {
var cpu = `${colorizedMetric(proc.cpu, 40, 70, '%')}`
var mem = `${colorizedMetric(proc.memory, 40, 70, '%')}`
var cmd = proc.cmd
if (proc.cmd.length > 50)
cmd = '…' + proc.cmd.slice(proc.cmd.length - 48, proc.cmd.length)
// if (proc.cmd.length > 50)
// cmd = '…' + proc.cmd.slice(proc.cmd.length - 48, proc.cmd.length)
sys_proc_table.push([chalk.bold.cyan(proc_id++), cmd, proc.pid, cpu, mem, proc.uid])
})
@ -566,8 +566,8 @@ UX.dispAsTable = function(list, sys_infos) {
var cpu = `${colorizedMetric(proc.cpu, 40, 70, '%')}`
var mem = `${colorizedMetric(proc.memory, 40, 70, '%')}`
var cmd = proc.cmd
if (proc.cmd.length > 50)
cmd = '…' + proc.cmd.slice(proc.cmd.length - 48, proc.cmd.length)
// if (proc.cmd.length > 50)
// cmd = '…' + proc.cmd.slice(proc.cmd.length - 48, proc.cmd.length)
sys_proc_table.push([chalk.bold.cyan(proc_id++), cmd, proc.pid, cpu, mem, proc.uid])
})