mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-01 01:25:45 -04:00
support json for keyword type
This commit is contained in:
parent
35ce54f30c
commit
a9d19ae06a
@ -81,7 +81,14 @@ class Monitor extends BeanModel {
|
|||||||
bean.status = 1;
|
bean.status = 1;
|
||||||
} else {
|
} 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.msg += ", keyword is found"
|
||||||
bean.status = 1;
|
bean.status = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<div class="mb-3" v-if="monitor.type === 'keyword' ">
|
<div class="mb-3" v-if="monitor.type === 'keyword' ">
|
||||||
<label for="keyword" class="form-label">Keyword</label>
|
<label for="keyword" class="form-label">Keyword</label>
|
||||||
<input type="text" class="form-control" id="keyword" v-model="monitor.keyword" required>
|
<input type="text" class="form-control" id="keyword" v-model="monitor.keyword" required>
|
||||||
<div class="form-text">Search keyword in plain html response and it is case-sensitive</div>
|
<div class="form-text">Search keyword in plain html or JSON response and it is case-sensitive</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3" v-if="monitor.type === 'port' || monitor.type === 'ping' ">
|
<div class="mb-3" v-if="monitor.type === 'port' || monitor.type === 'ping' ">
|
||||||
|
Loading…
Reference in New Issue
Block a user