mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-08 14:02:33 +02:00
fix(monitor): correctly get deprecated values from checks list
This commit is contained in:
parent
77c11a6a50
commit
8061bd8701
1 changed files with 6 additions and 3 deletions
|
@ -6,7 +6,10 @@ dayjs.extend(utc);
|
||||||
dayjs.extend(timezone);
|
dayjs.extend(timezone);
|
||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const { Prometheus } = require("../prometheus");
|
const { Prometheus } = require("../prometheus");
|
||||||
const { debug, UP, DOWN, PENDING, flipStatus, TimeLogger, MONITOR_CHECK_SELECTOR_TYPES } = require("../../src/util");
|
const { debug, UP, DOWN, PENDING, flipStatus, TimeLogger, MONITOR_CHECK_SELECTOR_TYPES,
|
||||||
|
HTTP_STATUS_CODE_SHOULD_EQUAL,
|
||||||
|
RESPONSE_SHOULD_CONTAIN_TEXT
|
||||||
|
} = require("../../src/util");
|
||||||
const { tcping, ping, dnsResolve, checkCertificate, getTotalClientInRoom } = require("../util-server");
|
const { tcping, ping, dnsResolve, checkCertificate, getTotalClientInRoom } = require("../util-server");
|
||||||
const { R } = require("redbean-node");
|
const { R } = require("redbean-node");
|
||||||
const { BeanModel } = require("redbean-node/dist/bean-model");
|
const { BeanModel } = require("redbean-node/dist/bean-model");
|
||||||
|
@ -75,8 +78,8 @@ class Monitor extends BeanModel {
|
||||||
tags: tags,
|
tags: tags,
|
||||||
|
|
||||||
// Deprecated: Use the values in the checks list instead
|
// Deprecated: Use the values in the checks list instead
|
||||||
accepted_statuscodes: JSON.parse(this.accepted_statuscodes_json),
|
accepted_statuscodes: ((this.checks || []).find(check => check.type === HTTP_STATUS_CODE_SHOULD_EQUAL) || {}).value,
|
||||||
keyword: this.keyword,
|
keyword: ((this.checks || []).find(check => check.type === RESPONSE_SHOULD_CONTAIN_TEXT) || {}).value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue