diff --git a/app/gather_info.sh b/app/gather_info.sh index d33e83a..5cde826 100755 --- a/app/gather_info.sh +++ b/app/gather_info.sh @@ -279,4 +279,31 @@ if command -v virsh &>/dev/null; then done fi +# Docker containers +if command -v docker &>/dev/null; then + _sudo docker ps -a --format '{{.Names}}\t{{.State}}\t{{.Image}}\t{{.Status}}' 2>/dev/null | while IFS=$'\t' read -r name state image status_text; do + [ -z "$name" ] && continue + echo "[container:docker-${name}]" + echo "type=docker" + echo "platform=docker" + echo "name=$name" + echo "status=$state" + echo "image=$image" + echo "status_text=$status_text" + if [ "$state" = "running" ]; then + # Get IP from docker inspect + docker_ip=$(_sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$name" 2>/dev/null) + [ -n "$docker_ip" ] && echo "ip=$docker_ip" + # Get memory/cpu stats (one-shot, no stream) + stats=$(_sudo docker stats --no-stream --format '{{.MemUsage}}\t{{.MemPerc}}\t{{.CPUPerc}}' "$name" 2>/dev/null) + if [ -n "$stats" ]; then + mem_pct=$(echo "$stats" | cut -f2 | tr -d '%') + cpu_pct=$(echo "$stats" | cut -f3 | tr -d '%') + echo "mem_percent=${mem_pct}" + echo "cpu_percent=${cpu_pct}" + fi + fi + done +fi + echo "[end]" diff --git a/app/static/style.css b/app/static/style.css index b91b43e..c81021b 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -386,6 +386,15 @@ main { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; } +.ct-image { + font-size: 0.7rem; + color: #475569; + margin-bottom: 4px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .ct-status-label { color: #64748b; font-style: italic; diff --git a/app/templates/index.html b/app/templates/index.html index 4414942..46e13ee 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -264,6 +264,9 @@ {{ ct.get('name', ct.get('id', '?')) }} {{ ct.get('type', '')|upper }} + {% if ct.get('image') %} +