From b6cd21c71a679ef8374fed0761c844748d7aa174 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 7 Jun 2024 15:54:28 +0200 Subject: [PATCH] Removed where I was wrong about imports --- server/monitor-types/dns.js | 6 +++++- server/monitor-types/mongodb.js | 6 +++++- server/monitor-types/monitor-type.js | 6 +++++- server/monitor-types/mqtt.js | 2 +- server/monitor-types/real-browser-monitor-type.js | 4 +++- server/monitor-types/tailscale-ping.js | 6 +++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/server/monitor-types/dns.js b/server/monitor-types/dns.js index 1a35a99d..d038b680 100644 --- a/server/monitor-types/dns.js +++ b/server/monitor-types/dns.js @@ -4,7 +4,7 @@ const dayjs = require("dayjs"); const { dnsResolve } = require("../util-server"); const { R } = require("redbean-node"); -export class DnsMonitorType extends MonitorType { +class DnsMonitorType extends MonitorType { name = "dns"; /** @@ -49,3 +49,7 @@ export class DnsMonitorType extends MonitorType { heartbeat.status = UP; } } + +module.exports = { + DnsMonitorType, +}; diff --git a/server/monitor-types/mongodb.js b/server/monitor-types/mongodb.js index 37ad3b46..73747db9 100644 --- a/server/monitor-types/mongodb.js +++ b/server/monitor-types/mongodb.js @@ -3,7 +3,7 @@ const { UP } = require("../../src/util"); const { MongoClient } = require("mongodb"); const jsonata = require("jsonata"); -export class MongodbMonitorType extends MonitorType { +class MongodbMonitorType extends MonitorType { name = "mongodb"; /** @@ -57,3 +57,7 @@ export class MongodbMonitorType extends MonitorType { return result; } } + +module.exports = { + MongodbMonitorType, +}; diff --git a/server/monitor-types/monitor-type.js b/server/monitor-types/monitor-type.js index c837b63a..8290bdd7 100644 --- a/server/monitor-types/monitor-type.js +++ b/server/monitor-types/monitor-type.js @@ -1,4 +1,4 @@ -export class MonitorType { +class MonitorType { name = undefined; /** @@ -12,3 +12,7 @@ export class MonitorType { throw new Error("You need to override check()"); } } + +module.exports = { + MonitorType, +}; diff --git a/server/monitor-types/mqtt.js b/server/monitor-types/mqtt.js index 2a4c1296..ad734ce8 100644 --- a/server/monitor-types/mqtt.js +++ b/server/monitor-types/mqtt.js @@ -3,7 +3,7 @@ const { log, UP } = require("../../src/util"); const mqtt = require("mqtt"); const jsonata = require("jsonata"); -export class MqttMonitorType extends MonitorType { +class MqttMonitorType extends MonitorType { name = "mqtt"; /** diff --git a/server/monitor-types/real-browser-monitor-type.js b/server/monitor-types/real-browser-monitor-type.js index 84b06d93..f1219af1 100644 --- a/server/monitor-types/real-browser-monitor-type.js +++ b/server/monitor-types/real-browser-monitor-type.js @@ -228,7 +228,8 @@ async function testRemoteBrowser(remoteBrowserURL) { throw new Error(e.message); } } -export class RealBrowserMonitorType extends MonitorType { +class RealBrowserMonitorType extends MonitorType { + name = "real-browser"; /** @@ -265,6 +266,7 @@ export class RealBrowserMonitorType extends MonitorType { } module.exports = { + RealBrowserMonitorType, testChrome, resetChrome, testRemoteBrowser, diff --git a/server/monitor-types/tailscale-ping.js b/server/monitor-types/tailscale-ping.js index 308ffa43..8537651c 100644 --- a/server/monitor-types/tailscale-ping.js +++ b/server/monitor-types/tailscale-ping.js @@ -2,7 +2,7 @@ const { MonitorType } = require("./monitor-type"); const { UP } = require("../../src/util"); const childProcessAsync = require("promisify-child-process"); -export class TailscalePing extends MonitorType { +class TailscalePing extends MonitorType { name = "tailscale-ping"; /** @@ -71,3 +71,7 @@ export class TailscalePing extends MonitorType { } } } + +module.exports = { + TailscalePing, +};