From 51e4fc6d74131f80d580531b37062f8655dd815b Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Mon, 26 Sep 2016 10:48:06 +0200 Subject: [PATCH 1/2] Drop our label-col width heuristic for less wasted col. space - The label column now flexes to the available space. (Old behaviour: label width was a function of # of cols). - Most columns other than the label now have a fixed width specified (some large ones are left to share the avaiable space w/ the label) --- .../node-details/node-details-table.js | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/client/app/scripts/components/node-details/node-details-table.js b/client/app/scripts/components/node-details/node-details-table.js index be58d0dac..d32e26a24 100644 --- a/client/app/scripts/components/node-details/node-details-table.js +++ b/client/app/scripts/components/node-details/node-details-table.js @@ -13,7 +13,7 @@ function isNumber(data) { const CW = { XS: '32px', S: '50px', - M: '80px', + M: '64px', L: '120px', XL: '140px', XXL: '170px', @@ -21,12 +21,15 @@ const CW = { const XS_LABEL = { - count: '#' + count: '#', + // TODO: consider changing the name of this field on the BE + container: '#', }; const COLUMN_WIDTHS = { count: CW.XS, + container: CW.XS, docker_container_created: CW.XL, docker_container_restart_count: CW.M, docker_container_state_human: CW.XXL, @@ -34,14 +37,16 @@ const COLUMN_WIDTHS = { docker_cpu_total_usage: CW.M, docker_memory_usage: CW.M, open_files_count: CW.M, - pid: CW.M, + pid: CW.S, port: CW.S, - ppid: CW.M, + ppid: CW.S, process_cpu_usage_percent: CW.M, process_memory_usage_bytes: CW.M, threads: CW.M, + // e.g. details panel > pods kubernetes_ip: CW.L, + kubernetes_state: CW.M, }; @@ -143,21 +148,7 @@ function getSortedNodes(nodes, sortByHeader, sortedDesc) { } -function getColumnWidth(headers, h, i) { - // - // Beauty hack: adjust first column width if there are only few columns; - // this assumes the other columns are narrow metric columns of 20% table width - // - if (i === 0) { - if (headers.length === 2) { - return '66%'; - } else if (headers.length === 3) { - return '50%'; - } else if (headers.length > 3 && headers.length <= 5) { - return '33%'; - } - } - +function getColumnWidth(headers, h) { // // More beauty hacking, ports and counts can only get so big, free up WS for other longer // fields like IPs! From f0a50b85e9e365d4420deb51b4b0fbb8be12b2c4 Mon Sep 17 00:00:00 2001 From: Simon Howe Date: Mon, 26 Sep 2016 11:02:32 +0200 Subject: [PATCH 2/2] Metrics cols a little wider again --- .../app/scripts/components/node-details/node-details-table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/scripts/components/node-details/node-details-table.js b/client/app/scripts/components/node-details/node-details-table.js index d32e26a24..1f07d45a7 100644 --- a/client/app/scripts/components/node-details/node-details-table.js +++ b/client/app/scripts/components/node-details/node-details-table.js @@ -13,7 +13,7 @@ function isNumber(data) { const CW = { XS: '32px', S: '50px', - M: '64px', + M: '70px', L: '120px', XL: '140px', XXL: '170px',