mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: enhance MonitorCriteriaInstance and MonitorMetricType to support additional monitor types
This commit is contained in:
@@ -476,7 +476,9 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
|
||||
}
|
||||
|
||||
return null;
|
||||
}(arg: {
|
||||
}
|
||||
|
||||
public static getDefaultOfflineMonitorCriteriaInstance(arg: {
|
||||
monitorType: MonitorType;
|
||||
monitorStatusId: ObjectID;
|
||||
incidentSeverityId: ObjectID;
|
||||
@@ -696,6 +698,7 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
|
||||
|
||||
if (
|
||||
arg.monitorType === MonitorType.API ||
|
||||
arg.monitorType === MonitorType.Website
|
||||
) {
|
||||
monitorCriteriaInstance.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
|
||||
@@ -86,7 +86,9 @@ class MonitorMetricTypeUtil {
|
||||
monitorType === MonitorType.IP ||
|
||||
monitorType === MonitorType.Port ||
|
||||
monitorType === MonitorType.SNMP ||
|
||||
monitorType === MonitorType.DNS
|
||||
monitorType === MonitorType.DNS ||
|
||||
monitorType === MonitorType.Domain ||
|
||||
monitorType === MonitorType.ExternalStatusPage
|
||||
) {
|
||||
return [MonitorMetricType.IsOnline, MonitorMetricType.ResponseTime];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user