From 01e95dde922feb6662083a77bfc33f7b5c8ecdea Mon Sep 17 00:00:00 2001 From: Unitech Date: Fri, 11 Oct 2019 15:30:16 +0200 Subject: [PATCH] fix: intensive process list is now condensed if small term --- lib/API/CliUx.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/API/CliUx.js b/lib/API/CliUx.js index a716dc64..95c3cd32 100644 --- a/lib/API/CliUx.js +++ b/lib/API/CliUx.js @@ -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]) })