From 5ba526d12e534dfbdf61c9084d5a36aa4bd37c45 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Wed, 1 Jan 2025 16:11:19 +0000 Subject: [PATCH] refactor: remove outdated comments and improve context object in VMRunner --- Common/Server/Utils/VM/VMRunner.ts | 3 +++ Dashboard/src/Components/Form/Monitor/MonitorStep.tsx | 3 --- Docs/Content/monitor/synthetic-monitor.md | 2 -- Probe/Index.ts | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Common/Server/Utils/VM/VMRunner.ts b/Common/Server/Utils/VM/VMRunner.ts index 613d04573d2..b7aa9dbb0da 100644 --- a/Common/Server/Utils/VM/VMRunner.ts +++ b/Common/Server/Utils/VM/VMRunner.ts @@ -29,6 +29,9 @@ export default class VMRunner { http: http, https: https, axios: axios, + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, ...options.context, }; diff --git a/Dashboard/src/Components/Form/Monitor/MonitorStep.tsx b/Dashboard/src/Components/Form/Monitor/MonitorStep.tsx index a8d64831880..9dcb2040992 100644 --- a/Dashboard/src/Components/Form/Monitor/MonitorStep.tsx +++ b/Dashboard/src/Components/Form/Monitor/MonitorStep.tsx @@ -238,9 +238,6 @@ const MonitorStepElement: FunctionComponent = ( if (props.monitorType === MonitorType.SyntheticMonitor) { codeEditorPlaceholder = ` - // You can use axios module, and page object from Playwright here. - // Page Object is a class that represents a single page in a browser. - // Objects available in the context of the script are: // - axios: Axios module to make HTTP requests diff --git a/Docs/Content/monitor/synthetic-monitor.md b/Docs/Content/monitor/synthetic-monitor.md index 7aa3b140df6..c8472dad1d9 100644 --- a/Docs/Content/monitor/synthetic-monitor.md +++ b/Docs/Content/monitor/synthetic-monitor.md @@ -7,8 +7,6 @@ Synthetic monitoring is a way to proactively monitor your applications by simula The following example shows how to use a Synthetic Monitor: ```javascript -// You can use axios module, and page object from Playwright here. -// Page Object is a class that represents a single page in a browser. // Objects available in the context of the script are: diff --git a/Probe/Index.ts b/Probe/Index.ts index d0f978615c9..4161014b0c4 100644 --- a/Probe/Index.ts +++ b/Probe/Index.ts @@ -9,7 +9,6 @@ import logger from "Common/Server/Utils/Logger"; import App from "Common/Server/Utils/StartServer"; import Telemetry from "Common/Server/Utils/Telemetry"; import "ejs"; -import Port from "Common/Types/Port"; const APP_NAME: string = "probe"; @@ -23,7 +22,7 @@ const init: PromiseVoidFunction = async (): Promise => { // init the app await App.init({ appName: APP_NAME, - port: new Port(3874), // some random port to start the server. Since this is the probe, it doesn't need to be exposed. + port: undefined, isFrontendApp: false, statusOptions: { liveCheck: async () => {},