feat: add per-monitor Globalping toggle
Add a globalpingEnabled boolean to the Monitor model so users can opt-in to global location checks per monitor during creation/edit. ## Changes - Add globalpingEnabled field to server types, Mongoose model, Joi validation, and repository mappers - Add globalpingEnabled to client Monitor type, Zod schemas for HTTP and ping monitors, and form defaults - Add "Global monitoring" ConfigBox with Switch toggle to the monitor creation/edit form, visible for HTTP and ping types - Queue helper and monitorService now check globalpingEnabled before running Globalping checks or fetching location data - Add translation keys for the new form section ## Benefits - Users can selectively enable Globalping on monitors that need it rather than running location checks on every HTTP/ping monitor - Reduces unnecessary API usage and keeps the UI clean for monitors that only need local checks
This commit is contained in:
1 parent
7f9d2f275e
commit
4ca24c794e
11 files changed
+47
-3
No files matched your search
@@ -223,9 +223,9 @@ export class MonitorService implements IMonitorService {
|
||||
throw new AppError({ message: `${monitor.type} monitors are not supported for uptime details`, status: 400 });
|
||||
}
|
||||
|
||||
// Fetch location checks if this is an HTTP or ping monitor
|
||||
// Fetch location checks if Globalping is enabled for this monitor
|
||||
let locationChecks: Record<string, LocationCheckData> | undefined;
|
||||
if (monitor.type === "http" || monitor.type === "ping") {
|
||||
if (monitor.globalpingEnabled && (monitor.type === "http" || monitor.type === "ping")) {
|
||||
const locData = await this.checksRepository.findLocationChecksByMonitorId(
|
||||
monitor.id,
|
||||
start,
|
||||
|
||||
Reference in new issue
Block a user