aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/vm/VmTile.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/vm/VmTile.qml')
-rw-r--r--desktop/modules/vm/VmTile.qml19
1 files changed, 17 insertions, 2 deletions
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
}