This commit is contained in:
Alex Holliday committed 2025-12-30 19:49:13 +00:00
1 parent dea0ff106f
commit f56f91c31d
4 files changed
+156 -3

No files matched your search

+24 -2
View File
@@ -560,14 +560,24 @@ class MonitorService implements IMonitorService {
runningPercent: {
$cond: [
{ $gt: ["$totalContainers", 0] },
{ $multiply: [{ $divide: ["$runningContainers", "$totalContainers"] }, 100] },
{
$multiply: [
{ $divide: ["$runningContainers", "$totalContainers"] },
100,
],
},
null,
],
},
healthyPercent: {
$cond: [
{ $gt: ["$totalContainers", 0] },
{ $multiply: [{ $divide: ["$healthyContainers", "$totalContainers"] }, 100] },
{
$multiply: [
{ $divide: ["$healthyContainers", "$totalContainers"] },
100,
],
},
null,
],
},
@@ -744,6 +754,18 @@ class MonitorService implements IMonitorService {
net: d.net,
};
}
if (monitor.type === "docker") {
return {
...base,
totalContainers: d.dockerTotalContainers,
runningContainers: d.dockerRunningContainers,
healthyContainers: d.dockerHealthyContainers,
totalExposedPorts: d.dockerTotalExposedPorts,
uniqueImages: d.dockerUniqueImages,
runningPercent: d.dockerRunningPercent,
healthyPercent: d.dockerHealthyPercent,
};
}
return base;
});