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:
GitHub Copilot
2026-01-24 11:33:27 +00:00
parent ff8f5efabd
commit 1f51d878c8
5 changed files with 517 additions and 3 deletions
+3
View File
@@ -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)