aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/vm/VmModule.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-22 11:18:54 +0200
committerDanilo M. <danix@danix.xyz>2026-10-22 11:18:54 +0200
commit38b64dda38c76fa11424cba8ed012cd94a56362e (patch)
tree7ce20fcb308c72d91f699db4ed15e779112f9e7e /desktop/modules/vm/VmModule.qml
parent761c1d31d80b3fd72602bb771f9eb2e86c31d20c (diff)
downloadquickshell-38b64dda38c76fa11424cba8ed012cd94a56362e.tar.gz
quickshell-38b64dda38c76fa11424cba8ed012cd94a56362e.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/vm/VmModule.qml')
-rw-r--r--desktop/modules/vm/VmModule.qml23
1 files changed, 15 insertions, 8 deletions
diff --git a/desktop/modules/vm/VmModule.qml b/desktop/modules/vm/VmModule.qml
index bc6b190..fa88cef 100644
--- a/desktop/modules/vm/VmModule.qml
+++ b/desktop/modules/vm/VmModule.qml
@@ -29,7 +29,7 @@ Module {
page: Component {
Page {
- title: "Virtual machines"
+ title: "VMs and containers"
VmPage { width: parent.width }
}
}
@@ -38,14 +38,21 @@ Module {
// the notification is the only feedback, since virsh output goes nowhere.
property Process notifyProc: Process {}
+ function notify(target, action, message) {
+ notifyProc.command = ["notify-send", "--app-name=vm-manager",
+ "--urgency=critical", "--icon=error",
+ `${action} failed: ${target}`, message];
+ notifyProc.running = false;
+ notifyProc.running = true;
+ }
+
property Connections conn: Connections {
target: Virsh
- function onActionFailed(vm, action, message) {
- mod.notifyProc.command = ["notify-send", "--app-name=vm-manager",
- "--urgency=critical", "--icon=error",
- `${action} failed: ${vm}`, message];
- mod.notifyProc.running = false;
- mod.notifyProc.running = true;
- }
+ function onActionFailed(vm, action, message) { mod.notify(vm, action, message); }
+ }
+
+ property Connections dockerConn: Connections {
+ target: Docker
+ function onActionFailed(target, action, message) { mod.notify(target, "docker " + action, message); }
}
}