Add CPU sparkline to dashboard in compose mode
- New docker_stats.py module reads container stats from Docker socket using only asyncio + stdlib (no new dependencies) - Calculates CPU % from delta of cpu_usage and system_cpu_usage - Maintains ring buffer of last 30 CPU readings per container - render_sparkline_svg() generates mini SVG chart from history - DockerStatsCollector polls containers every 2 seconds - New /cpu-sparkline.svg endpoint serves sparkline for a container - Dashboard shows sparkline in tile header next to container name - Only active in compose mode (--compose-manifest flag) - Graceful degradation if Docker socket unavailable Bump version to 0.1.17
This commit is contained in:
@@ -149,10 +149,12 @@ def app(
|
||||
_config = default_config()
|
||||
|
||||
landing_apps: list = []
|
||||
is_compose_mode = False
|
||||
if landing_manifest:
|
||||
landing_apps = load_landing_yaml(landing_manifest)
|
||||
elif compose_manifest:
|
||||
landing_apps = load_compose_manifest(compose_manifest)
|
||||
is_compose_mode = True
|
||||
|
||||
server = LocalServer(
|
||||
"./",
|
||||
@@ -160,6 +162,7 @@ def app(
|
||||
host=host,
|
||||
port=port,
|
||||
landing_apps=landing_apps,
|
||||
compose_mode=is_compose_mode,
|
||||
)
|
||||
for app_entry in landing_apps:
|
||||
server.add_terminal(app_entry.name, app_entry.command, slug=app_entry.slug)
|
||||
|
||||
Reference in New Issue
Block a user