@@ -72,19 +72,21 @@ proc header(tui: Tui, tb: var TerminalBuffer, info: FullInfoRef, cnt: int,
72
72
blog: string ) =
73
73
let mi = info.mem
74
74
tb.setCursorPos offset, 1
75
- tb.write bgCyan, info.sys.hostname, fgWhite, " : " ,
75
+ tb.write info.sys.hostname, " " ,
76
76
info.sys.datetime.format (
77
77
" yyyy-MM-dd HH:mm:ss" )
78
+ tb.write styleDim
78
79
if tui.hist > 0 :
79
- tb.write fmt" { blog} : { tui.hist} / { cnt} "
80
+ tb.write fmt" { blog} { tui.hist} / { cnt} "
80
81
elif blog == " " :
81
82
tb.write fmt" autoupdate log: empty "
82
83
else :
83
- tb.write fmt" autoupdate { blog} : { cnt} "
84
+ tb.write fmt" autoupdate { blog} { cnt } / { cnt} "
84
85
let curX = tb.getCursorXPos ()
85
86
if tb.width - curX - 2 > 0 :
86
87
tb.write ' ' .repeat (tb.width - curX - 2 )
87
88
tb.setCursorXPos curX
89
+ tb.write resetStyle
88
90
# let powerStr = fmt"{float(info.power) / 1000000:5.2f} W"
89
91
let procStr = fmt" PROCS: { $ info.pidsInfo.len} "
90
92
tb.writeR procStr
@@ -278,25 +280,31 @@ proc checkFilter(filter: string, p: PidInfo): bool =
278
280
proc table (tui: Tui , tb: var TerminalBuffer , pi: OrderedTableRef [uint , PidInfo ],
279
281
statsLen: int ) =
280
282
var y = tb.getCursorYPos () + 1
281
- tb.write styleBright
282
- tb.write (offset, y, bgBlue, fmt""" { " S" :1 } """ )
283
+ tb.write styleDim
284
+ tb.write (offset, y, fmt""" { " S" :1 } """ )
283
285
if not tui.group:
284
286
tb.write fmt""" { " PID" :>6 } """
285
287
tb.write fmt""" { " USER" :<8 } { " RSS" :>10 } { " MEM%" :>5 } { " CPU%" :>5 } { " r/w IO" :>9 } { " UP" :>8 } """
286
- if tui.threads:
288
+ if tui.group:
289
+ tb.write fmt""" { " CNT" :>3 } """
290
+ if tui.threads or tui.group:
287
291
tb.write fmt""" { " THR" :>3 } """
288
- elif tui.group:
289
- tb.write fmt""" { " CNT" :>3 } """
290
292
if tb.width - 63 > 0 :
291
293
tb.write ' ' .repeat (tb.width- 63 ), bgNone
292
294
inc y
293
- var i: uint = 0
295
+ var i = 0
296
+ tb.setStyle {}
294
297
tb.write fgColor
298
+ if tui.scrollY > 0 :
299
+ tb.setCursorPos (tb.width div 2 )- 1 , tb.getCursorYPos ()+ 1
300
+ tb.write " ..."
301
+ inc y
302
+ dec i
295
303
for (_, p) in pi.pairs:
296
304
if tui.filter.isSome:
297
305
if checkFilter (tui.filter.get, p):
298
306
continue
299
- elif i < uint tui.scrollY:
307
+ elif i < tui.scrollY:
300
308
inc i
301
309
continue
302
310
tb.setCursorPos offset, y
@@ -325,8 +333,10 @@ proc table(tui: Tui, tb: var TerminalBuffer, pi: OrderedTableRef[uint, PidInfo],
325
333
326
334
let lvl = p.parents.len
327
335
var cmd = " "
336
+ if tui.group:
337
+ tb.write " " , p.count.formatN3 ()
328
338
if tui.threads or tui.group:
329
- tb.write " " , ( $ p.threads). cut ( 3 , true , tui.scrollX ), " "
339
+ tb.write " " , p.threads. formatN3 ( ), " "
330
340
if lvl > 0 :
331
341
tb.write fgCyan, repeat (" ·" , lvl)
332
342
else :
0 commit comments