diff --git a/server/model/monitor.js b/server/model/monitor.js index b8e8eb30..16277287 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -81,7 +81,14 @@ class Monitor extends BeanModel { bean.status = 1; } else { - if (res.data.includes(this.keyword)) { + let data = res.data; + + // Convert to string for object/array + if (typeof data !== "string") { + data = JSON.stringify(data) + } + + if (data.includes(this.keyword)) { bean.msg += ", keyword is found" bean.status = 1; } else { diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 7054d73a..01af5061 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -30,7 +30,7 @@
-
Search keyword in plain html response and it is case-sensitive
+
Search keyword in plain html or JSON response and it is case-sensitive