containers: Docker (and best-effort Podman) plugin
- minimal Docker Engine API client over Unix/TCP sockets with version negotiation and chunked response decoding - drop-in stats schema: active/stopped containers, CPU/memory/IO/network rates, ports, uptime (pretty_date), image, engine field - Docker + Podman engines, config (all, podman_sock, max_name_size, disable_stats, show/hide, per-container thresholds) - export strips the computation sub-dicts (--stdout/--stdout-csv) - TUI block above the process count - CI-safe fake Docker socket test + live differential parity
This commit is contained in:
@@ -389,6 +389,32 @@ impl Tui {
|
||||
}
|
||||
let mut y = area.y;
|
||||
|
||||
// Containers (above the process count, like the Python right sidebar).
|
||||
if let Some(plugin) = engine.plugins.get_mut("containers")
|
||||
&& plugin.is_enabled()
|
||||
{
|
||||
let ctx = render_ctx(args, &engine.runtime, right_width as usize);
|
||||
let lines = split_lines(plugin.render(&ctx));
|
||||
if !lines.is_empty() {
|
||||
let max_height = (area.y + area.height).saturating_sub(y).saturating_sub(4);
|
||||
let height = (lines.len() as u16).min(max_height);
|
||||
if height > 0 {
|
||||
draw_lines(
|
||||
frame,
|
||||
Rect {
|
||||
x: right_x,
|
||||
y,
|
||||
width: right_width,
|
||||
height,
|
||||
},
|
||||
&lines,
|
||||
args,
|
||||
);
|
||||
y += height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Process count.
|
||||
if let Some(plugin) = engine.plugins.get_mut("processcount")
|
||||
&& plugin.is_enabled()
|
||||
@@ -916,7 +942,7 @@ mod tests {
|
||||
"--disable-plugin",
|
||||
"all",
|
||||
"--enable-plugin",
|
||||
"cpu,mem,load,processlist,processcount,network,fs,diskio,now,system,uptime,quicklook",
|
||||
"cpu,mem,load,processlist,processcount,containers,network,fs,diskio,now,system,uptime,quicklook",
|
||||
]);
|
||||
args.time = Some(1.0);
|
||||
let config = Config::empty(false);
|
||||
|
||||
Reference in New Issue
Block a user