mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 08:44:04 +00:00
style: fix formatting
This commit is contained in:
parent
50d6ea36a4
commit
90b9173cfb
1 changed files with 17 additions and 16 deletions
|
@ -382,8 +382,8 @@ class Monitor extends BeanModel {
|
||||||
|
|
||||||
if (children.length > 0) {
|
if (children.length > 0) {
|
||||||
bean.status = UP;
|
bean.status = UP;
|
||||||
bean.msg = "";
|
bean.msg = "";
|
||||||
let errorChildNames = [];
|
let errorChildNames = [];
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
if (!child.active) {
|
if (!child.active) {
|
||||||
// Ignore inactive childs
|
// Ignore inactive childs
|
||||||
|
@ -401,23 +401,24 @@ class Monitor extends BeanModel {
|
||||||
bean.status = lastBeat.status;
|
bean.status = lastBeat.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lastBeat && (lastBeat.status === PENDING || lastBeat.status === DOWN)) {
|
if (lastBeat && (lastBeat.status === PENDING || lastBeat.status === DOWN)) {
|
||||||
console.log(lastBeat.monitor_id);
|
console.log(lastBeat.monitor_id);
|
||||||
const childMonitor = await Monitor.getMonitor(lastBeat.monitor_id);
|
const childMonitor = await Monitor.getMonitor(lastBeat.monitor_id);
|
||||||
console.log(childMonitor)
|
console.log(childMonitor);
|
||||||
if(errorChildNames.length > 0)
|
if (errorChildNames.length > 0) {
|
||||||
bean.msg += "\r\n";
|
bean.msg += "\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
bean.msg += "- " + childMonitor.name + ":\r\n" + lastBeat.msg.trim().replace(/^/gm, " ");
|
bean.msg += "- " + childMonitor.name + ":\r\n" + lastBeat.msg.trim().replace(/^/gm, " ");
|
||||||
errorChildNames.push(childMonitor.name);
|
errorChildNames.push(childMonitor.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bean.status === UP) {
|
if (bean.status === UP) {
|
||||||
bean.msg = "All children up and running";
|
bean.msg = "All children up and running";
|
||||||
} else if(bean.status === PENDING || bean.status === DOWN) {
|
} else if (bean.status === PENDING || bean.status === DOWN) {
|
||||||
bean.msg = "Some Children are having problems (" + errorChildNames.join(', ') + ")\r\n" + bean.msg;
|
bean.msg = "Some Children are having problems (" + errorChildNames.join(", ") + ")\r\n" + bean.msg;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Set status pending if group is empty
|
// Set status pending if group is empty
|
||||||
bean.status = PENDING;
|
bean.status = PENDING;
|
||||||
|
@ -1618,7 +1619,7 @@ class Monitor extends BeanModel {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets Monitor with specific ID
|
* Gets Monitor with specific ID
|
||||||
* @param {number} monitorID ID of monitor to get
|
* @param {number} monitorID ID of monitor to get
|
||||||
* @returns {Promise<LooseObject<any>>} Children
|
* @returns {Promise<LooseObject<any>>} Children
|
||||||
|
|
Loading…
Reference in a new issue