From 38b64dda38c76fa11424cba8ed012cd94a56362e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 11:18:54 +0200 Subject: vm: show docker containers beside the VMs Docker.qml mirrors Virsh: the docker CLI, an event stream that runs for the whole session, and `docker stats --no-stream` on the 2s timer only while the page is up. Containers are grouped by compose project, since a stack is a dozen containers that start and stop together; a container outside any project is a group of one. Verbs are start, stop, restart and resume, by container id, so no compose file is needed and nothing removes a container. The event stream is filtered to lifecycle events: health checks emit exec_* events every few seconds per container, which would make the stream a poll. It dies with the daemon, so it is retried every 10s. An inactive Loader keeps its last height and a Column still reserves it, so collapsing one card left an empty box where its detail had been. Both the container and VM detail loaders now hide while inactive; the VM one had the same bug, unseen with a single VM. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/vm/VmTile.qml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'desktop/modules/vm/VmTile.qml') diff --git a/desktop/modules/vm/VmTile.qml b/desktop/modules/vm/VmTile.qml index a86258a..370b468 100644 --- a/desktop/modules/vm/VmTile.qml +++ b/desktop/modules/vm/VmTile.qml @@ -33,10 +33,25 @@ Row { } } + // Then one per compose project, green only when all of it is up. + Repeater { + model: Docker.projects + + Rectangle { + required property string modelData + readonly property var cs: Docker.groups[modelData] ?? [] + readonly property int up: cs.filter(c => c.state === "running").length + + anchors.verticalCenter: parent.verticalCenter + width: 7; height: 7; radius: 2 + color: up === 0 ? Theme.overlay : up === cs.length ? Theme.green : Theme.yellow + } + } + Text { anchors.verticalCenter: parent.verticalCenter - visible: Virsh.names.length === 0 - text: "no VMs" + visible: Virsh.names.length === 0 && Docker.projects.length === 0 + text: "none" font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } color: Theme.subtext } -- cgit v1.2.3