This commit is contained in:
Simon Larsen 2023-06-06 20:56:08 +01:00
parent 05199efd12
commit 742ee7c3cf
No known key found for this signature in database
GPG key ID: AB45983AA9C81CDE
3 changed files with 14 additions and 9 deletions

View file

@ -84,7 +84,9 @@ export default class MonitorStep extends DatabaseProperty {
return this;
}
public setMonitorDestination(monitorDestination: URL | IP | Hostname): MonitorStep {
public setMonitorDestination(
monitorDestination: URL | IP | Hostname
): MonitorStep {
this.data!.monitorDestination = monitorDestination;
return this;
}
@ -182,7 +184,8 @@ export default class MonitorStep extends DatabaseProperty {
if (
json &&
json['monitorDestination'] &&
(json['monitorDestination'] as JSONObject)['_type'] === ObjectType.URL
(json['monitorDestination'] as JSONObject)['_type'] ===
ObjectType.URL
) {
monitorDestination = URL.fromJSON(
json['monitorDestination'] as JSONObject
@ -192,7 +195,8 @@ export default class MonitorStep extends DatabaseProperty {
if (
json &&
json['monitorDestination'] &&
(json['monitorDestination'] as JSONObject)['_type'] === ObjectType.Hostname
(json['monitorDestination'] as JSONObject)['_type'] ===
ObjectType.Hostname
) {
monitorDestination = Hostname.fromJSON(
json['monitorDestination'] as JSONObject
@ -202,7 +206,8 @@ export default class MonitorStep extends DatabaseProperty {
if (
json &&
json['monitorDestination'] &&
(json['monitorDestination'] as JSONObject)['_type'] === ObjectType.IP
(json['monitorDestination'] as JSONObject)['_type'] ===
ObjectType.IP
) {
monitorDestination = IP.fromJSON(
json['monitorDestination'] as JSONObject

View file

@ -131,7 +131,8 @@ const MonitorStepElement: FunctionComponent<ComponentProps> = (
: undefined
}
onChange={(value: string) => {
let destination: IP | URL | Hostname | undefined = undefined;
let destination: IP | URL | Hostname | undefined =
undefined;
try {
if (props.monitorType === MonitorType.IP) {

View file

@ -31,7 +31,7 @@ export default class PingMonitor {
hostAddress = host.toString();
}
logger.info("Pinging host: " + hostAddress);
logger.info('Pinging host: ' + hostAddress);
try {
const res: ping.PingResponse = await ping.promise.probe(
@ -43,7 +43,7 @@ export default class PingMonitor {
}
);
logger.info("Pinging host "+hostAddress+" success: ");
logger.info('Pinging host ' + hostAddress + ' success: ');
logger.info(res);
return {
@ -53,8 +53,7 @@ export default class PingMonitor {
: undefined,
};
} catch (err) {
logger.info("Pinging host "+hostAddress+" error: ");
logger.info('Pinging host ' + hostAddress + ' error: ');
logger.info(err);
if (!retry) {