Merge 8e65712108 into 9169a647cb
This commit is contained in:
commit
6bf6b5f523
@ -1057,6 +1057,14 @@ let needSetup = false;
|
||||
await startMonitor(socket.userID, monitorID);
|
||||
await server.sendUpdateMonitorIntoList(socket, monitorID);
|
||||
|
||||
const monitor = await R.findOne("monitor", " id = ? ", [monitorID]);
|
||||
if (monitor && monitor.type === "group") {
|
||||
const childrenIDs = await Monitor.getAllChildrenIDs(monitorID);
|
||||
for (const childID of childrenIDs) {
|
||||
await server.sendUpdateMonitorIntoList(socket, childID);
|
||||
}
|
||||
}
|
||||
|
||||
callback({
|
||||
ok: true,
|
||||
msg: "successResumed",
|
||||
@ -1076,6 +1084,14 @@ let needSetup = false;
|
||||
await pauseMonitor(socket.userID, monitorID);
|
||||
await server.sendUpdateMonitorIntoList(socket, monitorID);
|
||||
|
||||
const monitor = await R.findOne("monitor", " id = ? ", [monitorID]);
|
||||
if (monitor && monitor.type === "group") {
|
||||
const childrenIDs = await Monitor.getAllChildrenIDs(monitorID);
|
||||
for (const childID of childrenIDs) {
|
||||
await server.sendUpdateMonitorIntoList(socket, childID);
|
||||
}
|
||||
}
|
||||
|
||||
callback({
|
||||
ok: true,
|
||||
msg: "successPaused",
|
||||
|
||||
@ -3171,9 +3171,12 @@ message HealthCheckResponse {
|
||||
}
|
||||
|
||||
let createdNewParent = false;
|
||||
let parentCreatedAsActive = false;
|
||||
|
||||
if (this.draftGroupName && this.monitor.parent === -1) {
|
||||
// Create Monitor with name of draft group
|
||||
const parentActive = this.isClone ? this.monitor.active !== false : false;
|
||||
parentCreatedAsActive = parentActive;
|
||||
const res = await new Promise((resolve) => {
|
||||
this.$root.add(
|
||||
{
|
||||
@ -3181,7 +3184,7 @@ message HealthCheckResponse {
|
||||
type: "group",
|
||||
name: this.draftGroupName,
|
||||
interval: this.monitor.interval,
|
||||
active: false,
|
||||
active: parentActive,
|
||||
},
|
||||
resolve
|
||||
);
|
||||
@ -3203,7 +3206,7 @@ message HealthCheckResponse {
|
||||
await this.$refs.tagsManager.submit(res.monitorID);
|
||||
|
||||
// Start the new parent monitor after edit is done
|
||||
if (createdNewParent) {
|
||||
if (createdNewParent && !parentCreatedAsActive) {
|
||||
await this.startParentGroupMonitor();
|
||||
}
|
||||
this.processing = false;
|
||||
@ -3223,7 +3226,7 @@ message HealthCheckResponse {
|
||||
this.init();
|
||||
|
||||
// Start the new parent monitor after edit is done
|
||||
if (createdNewParent) {
|
||||
if (createdNewParent && !parentCreatedAsActive) {
|
||||
this.startParentGroupMonitor();
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user