diff --git a/server/monitor-types/sip-options.js b/server/monitor-types/sip-options.js index 1ca60ad22..0237ed890 100644 --- a/server/monitor-types/sip-options.js +++ b/server/monitor-types/sip-options.js @@ -1,5 +1,5 @@ const { MonitorType } = require("./monitor-type"); -const { UP, log } = require("../../src/util"); +const { UP } = require("../../src/util"); const { exec } = require("promisify-child-process"); class SIPMonitorType extends MonitorType { @@ -10,7 +10,7 @@ class SIPMonitorType extends MonitorType { * Run the monitoring check on the given monitor * @param {Monitor} monitor Monitor to check * @param {Heartbeat} heartbeat Monitor heartbeat to update - * @param {UptimeKumaServer} server Uptime Kuma server + * @param {UptimeKumaServer} _server Uptime Kuma server * @returns {Promise} * @throws Will throw an error if the command execution encounters any error. */ @@ -32,7 +32,7 @@ class SIPMonitorType extends MonitorType { * @throws Will throw an error if the command execution encounters any error. */ async runSipSak(hostname, port, timeout) { - const { stdout, stderr } = await exec(`sipsak -s sip:${hostname}:${port} --from sip:sipsak@${hostname} -v`,{timeout:timeout}); + const { stdout, stderr } = await exec(`sipsak -s sip:${hostname}:${port} --from sip:sipsak@${hostname} -v`, { timeout: timeout }); if (!stdout && stderr && stderr.toString()) { throw new Error(`Error in output: ${stderr.toString()}`); } @@ -44,22 +44,21 @@ class SIPMonitorType extends MonitorType { } /** - * - * @param {string} res - * @param {object} heartbeat - * @returns {void} + * @param {string} res response to be parsed + * @param {object} heartbeat heartbeat object to update + * @returns {void} returns nothing */ - parseSipsakResponse(res, heartbeat){ + parseSipsakResponse(res, heartbeat) { let lines = res.split("\n"); - for (let line of lines){ - if (line.includes("200 OK")){ + for (let line of lines) { + if (line.includes("200 OK")) { heartbeat.status = UP; heartbeat.msg = line; break; } } } -} +} module.exports = { SIPMonitorType, diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index b8334458f..211cba56e 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -93,7 +93,7 @@ +