Merge remote-tracking branch 'origin/1.19.X'

# Conflicts:
#	package-lock.json
#	package.json
#	src/util-frontend.js
This commit is contained in:
Louis Lam 2023-01-17 21:17:04 +08:00
commit c47b6c5995
45 changed files with 624 additions and 2624 deletions

View file

@ -38,7 +38,6 @@ class Monitor extends BeanModel {
id: this.id,
name: this.name,
sendUrl: this.sendUrl,
maintenance: await Monitor.isUnderMaintenance(this.id),
};
if (this.sendUrl) {
@ -765,6 +764,13 @@ class Monitor extends BeanModel {
}
}
/**
* Make a request using axios
* @param {Object} options Options for Axios
* @param {boolean} finalCall Should this be the final call i.e
* don't retry on faliure
* @returns {Object} Axios response
*/
async makeAxiosRequest(options, finalCall = false) {
try {
let res;
@ -1246,6 +1252,7 @@ class Monitor extends BeanModel {
return maintenance.count !== 0;
}
/** Make sure monitor interval is between bounds */
validate() {
if (this.interval > MAX_INTERVAL_SECOND) {
throw new Error(`Interval cannot be more than ${MAX_INTERVAL_SECOND} seconds`);