From b02b21299beaade5aa922198b3122bf3b7cd57be Mon Sep 17 00:00:00 2001 From: Peace Date: Mon, 14 Oct 2024 00:01:55 +0200 Subject: [PATCH] feat: set group to pending if all childs are paused. --- server/model/monitor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 5b7e5871a..aa3339582 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -380,7 +380,11 @@ class Monitor extends BeanModel { } else if (this.type === "group") { const children = await Monitor.getChildren(this.id); - if (children.length > 0) { + if (children.length > 0 && children.filter(child => child.active).length === 0) { + // Set status pending if all children are paused + bean.status = PENDING; + bean.msg = "All Children are paused."; + } else if (children.length > 0) { bean.status = UP; bean.msg = "All children up and running"; for (const child of children) {