This repository was archived by the owner on Jul 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
plugins/plugin-kubectl/view-utilization/src/controller Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -202,13 +202,34 @@ export async function topNode(
202
202
value : strings ( 'Allocatable Memory' )
203
203
} )
204
204
205
+ // hide-with-sidecar the memory and cpu columns
206
+ const cpuIdx = nodeTable . header . attributes . findIndex ( _ => _ . key === 'CPU(cores)' )
207
+ if ( cpuIdx >= 0 ) {
208
+ nodeTable . header . attributes [ cpuIdx ] . outerCSS = `${ nodeTable . header . attributes [ cpuIdx ] . outerCSS ||
209
+ '' } hide-with-sidecar`
210
+ }
211
+ const memIdx = nodeTable . header . attributes . findIndex ( _ => _ . key === 'MEMORY(bytes)' )
212
+ if ( memIdx >= 0 ) {
213
+ nodeTable . header . attributes [ memIdx ] . outerCSS = `${ nodeTable . header . attributes [ memIdx ] . outerCSS ||
214
+ '' } hide-with-sidecar`
215
+ }
216
+
205
217
// don't hide-with-sidecar the mem% column
206
- nodeTable . header . attributes [ 3 ] . outerCSS = nodeTable . header . attributes [ 2 ] . outerCSS . replace ( / h i d e - w i t h - s i d e c a r / , '' )
218
+ const memPercentIdx = nodeTable . header . attributes . findIndex ( _ => _ . key === 'MEMORY%' )
219
+ nodeTable . header . attributes [ memPercentIdx ] . outerCSS = nodeTable . header . attributes [ memPercentIdx ] . outerCSS . replace (
220
+ / h i d e - w i t h - s i d e c a r / ,
221
+ ''
222
+ )
207
223
208
224
nodeTable . body . forEach ( row => {
209
225
row . onclick = `kubectl top pod --node ${ args . REPL . encodeComponent ( row . name ) } `
210
226
row . onclickSilence = false
211
227
228
+ const cpuAttr = row . attributes . find ( _ => _ . key === 'CPU(cores)' )
229
+ if ( cpuAttr ) {
230
+ cpuAttr . outerCSS = `${ cpuAttr . outerCSS || '' } hide-with-sidecar`
231
+ }
232
+
212
233
const cpuPercentAttr = row . attributes . find ( _ => _ . key === 'CPU%' )
213
234
if ( cpuPercentAttr ) {
214
235
cpuPercentAttr . valueDom = bar ( { color : BarColor . CPU , fractionString : cpuPercentAttr . value , text : true } )
You can’t perform that action at this time.
0 commit comments